StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdWafer.cc
1 
2 
3 // $Id: StSsdWafer.cc,v 1.16 2015/08/06 17:46:53 smirnovd Exp $
4 //
5 // $Log: StSsdWafer.cc,v $
6 // Revision 1.16 2015/08/06 17:46:53 smirnovd
7 // Removed unused local variables
8 //
9 // Revision 1.15 2014/10/18 19:31:56 smirnovd
10 // Revert "1st commit" asked by Jonathan
11 //
12 // Revision 1.13 2009/10/29 18:36:00 fine
13 // Char_t *xyz type to be const
14 //
15 // Revision 1.12 2009/02/23 21:10:40 bouchet
16 // increase NSaturationSignal to reflect the energy increase of the GEANT hit
17 //
18 // Revision 1.11 2008/07/16 21:00:38 bouchet
19 // default writePointToContainer : no quality hits calculation
20 //
21 // Revision 1.10 2008/05/07 22:48:37 bouchet
22 // calculation of quality of hits used embedding
23 //
24 // Revision 1.9 2008/04/12 14:22:36 bouchet
25 // Add a method to fill with constant noise and pedestal
26 //
27 // Revision 1.8 2008/01/11 10:40:38 bouchet
28 // Use of the wafer configuration table
29 //
30 // Revision 1.7 2007/08/07 19:58:10 fine
31 // Protect against of died object
32 //
33 // Revision 1.6 2007/07/03 16:28:38 fisyak
34 // Add protection against division 0/0
35 //
36 // Revision 1.5 2007/07/01 15:47:37 bouchet
37 // add method to remove strips which signal < 3*rms
38 //
39 // Revision 1.4 2007/03/27 23:11:48 bouchet
40 // Add a method to use the gain calibration for the Charge Matching between pulse of p and n sides
41 //
42 // Revision 1.3 2007/03/21 17:20:41 fisyak
43 // use TGeoHMatrix for coordinate transformation
44 //
45 // Revision 1.2 2007/03/01 22:32:18 bouchet
46 // bug fixed : fill the StSsdPointList with space points with the higher configuration probability
47 //
48 // Revision 1.1 2006/10/16 16:43:30 bouchet
49 // StSsdUtil regroups now methods for the classes StSsdStrip, StSsdCluster and StSsdPoint
50 //
51 // Revision 1.14 2006/09/15 21:03:14 bouchet
52 // id_mctrack is using for setIdTruth and propagated to the hit
53 //
54 // Revision 1.13 2005/12/23 21:33:17 perev
55 // Some defence for 1/0 added
56 //
57 // Revision 1.12 2005/04/25 14:13:24 bouchet
58 // new method makeScfCtrlHistograms and makeScmCtrlHistograms and Clusternoise is coded as a float
59 //
60 // Revision 1.11 2005/03/18 16:42:18 lmartin
61 // setMatcheds method modified to transmit the cluster Ids to the point
62 //
63 // Revision 1.10 2005/03/18 14:59:32 lmartin
64 // setPedestalSigmaStrip method added, setSigmaStrip removed
65 //
66 // Revision 1.9 2005/03/18 14:01:32 lmartin
67 // Remove first include accidentaly added
68 //
69 // Revision 1.8 2005/03/18 13:55:50 lmartin
70 // missing CVS header added
71 #include "StSsdUtil/StSsdWafer.hh"
72 #include <Stiostream.h>
73 #include "TMath.h"
74 #include "StMessMgr.h"
75 
76 //________________________________________________________________________________
77 StSsdWafer::StSsdWafer(Int_t nid) : TGeoHMatrix(), mDebug(0) {
78  memset(first, 0, last-first);
79  mId = nid;
80 
81  mStripP = new StSsdStripList();
82  mStripN = new StSsdStripList();
83  mNoiseP = new StSpaListNoise();
84  mNoiseN = new StSpaListNoise();
85  mClusterP = new StSsdClusterList();
86  mClusterN = new StSsdClusterList();
87  mPackage = new StSsdPackageList();
88  mPoint = new StSsdPointList();
89 }
90 //________________________________________________________________________________
91 StSsdWafer::~StSsdWafer() {
92  delete mStripP;
93  delete mStripN;
94  delete mNoiseP;
95  delete mNoiseN;
96  delete mClusterP;
97  delete mClusterN;
98  delete mPackage;
99  delete mPoint;
100 }
101 //________________________________________________________________________________
102 void StSsdWafer::Reset() {
103  delete mStripP;
104  delete mStripN;
105  delete mNoiseP;
106  delete mNoiseN;
107  delete mClusterP;
108  delete mClusterN;
109  delete mPackage;
110  delete mPoint;
111  mStripP = new StSsdStripList();
112  mStripN = new StSsdStripList();
113  mNoiseP = new StSpaListNoise();
114  mNoiseN = new StSpaListNoise();
115  mClusterP = new StSsdClusterList();
116  mClusterN = new StSsdClusterList();
117  mPackage = new StSsdPackageList();
118  mPoint = new StSsdPointList();
119 }
120 //________________________________________________________________________________
126 void StSsdWafer::init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX)
127 {
128  if (rId != mId) cout<<" Can not initialize wafer number : "<<mId<<" with "<<rId<<"\n";
129  else {
130  SetName(Form("R%04i",rId));
131  Double_t rot[9] = {
132  rD[0], rT[0], rN[0],
133  rD[1], rT[1], rN[1],
134  rD[2], rT[2], rN[2]
135  };
136  SetRotation(rot);
137  SetTranslation(rX);
138  }
139 }
140 //________________________________________________________________________________
141 void StSsdWafer::debugStrips()
142 {
143  StSsdStrip *currentStripP = 0;
144  cout<<"List of "<<mStripP->getSize()<<" strips on the P side "<<endl;
145  if (mStripP->getSize()>0) currentStripP = mStripP->first();
146  for (Int_t i=0;i<mStripP->getSize();i++) {
147  cout<<" id,sig,noise : "<<currentStripP->getNStrip()
148  <<" "<<currentStripP->getDigitSig()
149  <<" "<<currentStripP->getSigma()<<endl;
150  if (currentStripP!=mStripP->last()) currentStripP = mStripP->next(currentStripP);
151  }
152 
153  StSsdStrip *currentStripN = 0;
154  cout<<"List of "<<mStripN->getSize()<<" strips on the N side "<<endl;
155  if (mStripN->getSize()>0) currentStripN = mStripN->first();
156  for (Int_t i=0;i<mStripN->getSize();i++) {
157  cout<<" id,sig,noise : "<<currentStripN->getNStrip()
158  <<" "<<currentStripN->getDigitSig()
159  <<" "<<currentStripN->getSigma()<<endl;
160  if (currentStripN!=mStripN->last()) currentStripN = mStripN->next(currentStripN);
161  }
162 }
163 //________________________________________________________________________________
164 void StSsdWafer::debugClusters()
165 {
166  StSsdCluster *currentClusterP = 0;
167  cout<<"List of "<<mClusterP->getSize()<<" clusters on the P side "<<endl;
168  if (mClusterP->getSize()>0) currentClusterP = mClusterP->first();
169  for (Int_t i=0;i<mClusterP->getSize();i++) {
170  cout<<"N,Size,FirstStrip,StripMean,TotAdc,FirstAdc,LastAdc,TotNoise : "<<currentClusterP->getNCluster()
171  <<" "<<currentClusterP->getClusterSize()
172  <<" "<<currentClusterP->getFirstStrip()
173  <<" "<<currentClusterP->getStripMean()
174  <<" "<<currentClusterP->getTotAdc()
175  <<" "<<currentClusterP->getFirstAdc()
176  <<" "<<currentClusterP->getLastAdc()
177  <<" "<<currentClusterP->getTotNoise()<<endl;
178  if (currentClusterP!=mClusterP->last()) currentClusterP = mClusterP->next(currentClusterP);
179  }
180 
181  StSsdCluster *currentClusterN = 0;
182  cout<<"List of "<<mClusterN->getSize()<<" clusters on the P side "<<endl;
183  if (mClusterN->getSize()>0) currentClusterN = mClusterN->first();
184  for (Int_t i=0;i<mClusterN->getSize();i++) {
185  cout<<"N,Size,FirstStrip,StripMean,TotAdc,FirstAdc,LastAdc,TotNoise : "<<currentClusterN->getNCluster()
186  <<" "<<currentClusterN->getClusterSize()
187  <<" "<<currentClusterN->getFirstStrip()
188  <<" "<<currentClusterN->getStripMean()
189  <<" "<<currentClusterN->getTotAdc()
190  <<" "<<currentClusterN->getFirstAdc()
191  <<" "<<currentClusterN->getLastAdc()
192  <<" "<<currentClusterN->getTotNoise()<<endl;
193  if (currentClusterN!=mClusterN->last()) currentClusterN = mClusterN->next(currentClusterN);
194  }
195 
196 }
197 //________________________________________________________________________________
201 void StSsdWafer::addStrip(StSsdStrip *ptr, Int_t iSide)
202 {
203  if (iSide)
204  { mStripN->addNewStrip(ptr); }
205  else
206  { mStripP->addNewStrip(ptr); }
207 }
208 //________________________________________________________________________________
212 void StSsdWafer::addCluster(StSsdCluster *ptr, Int_t iSide)
213 {
214  if (iSide)
215  { mClusterN->addNewCluster(ptr); }
216  else
217  { mClusterP->addNewCluster(ptr); }
218 }
219 //________________________________________________________________________________
224 { mPackage->addNewPackage(ptr); }
225 //________________________________________________________________________________
230 { mPoint->addNewPoint(ptr); }
231 //________________________________________________________________________________
232 void StSsdWafer::setPedestalSigmaStrip(Int_t iStrip, Int_t iSide, Int_t iPedestal, Int_t iSigma, StSsdDynamicControl *dynamicControl)
233 {
234  if (iSide)
235  { mStripN->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
236  else
237  { mStripP->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
238 }
239 //________________________________________________________________________________
244 {
245  mStripP->sortStrip();
246  mStripN->sortStrip();
247 }
248 //________________________________________________________________________________
253 {
254  mClusterP->sortCluster();
255  mClusterN->sortCluster();
256 }
257 //________________________________________________________________________________
262 { mPoint->sortPoint(); }
263 //________________________________________________________________________________
270 void StSsdWafer::doClusterisation(Int_t *NClusterPerSide, StSsdClusterControl *clusterControl)
271 {
272  Int_t iSide = 0;
273  doFindCluster(clusterControl, iSide);
274  NClusterPerSide[0] = doClusterSplitting(clusterControl, iSide);
275  iSide = 1;
276  doFindCluster(clusterControl, iSide);
277  NClusterPerSide[1] = doClusterSplitting(clusterControl, iSide);
278 }
279 //______________________________________________________________
280 void StSsdWafer::doCleanListStrip(StSsdStripList *myStripList)
281 {
282  Int_t lowCut = 3;
283 
284  StSsdStripList *cleanListStrip;
285  // cleanListStrip = new StSsdStripList();
286  cleanListStrip = myStripList;
287  StSsdStrip *myStrip = 0;
288  StSsdStrip *copyStrip = cleanListStrip->first();
289  int size = cleanListStrip->getSize();
290  for(Int_t i=0;i<size;i++){
291  //printf("%d over %d strips signal=%d id=%d noise=%f\n",i,cleanListStrip->getSize()-1,copyStrip->getDigitSig(),copyStrip->getNStrip(),copyStrip->getSigma());
292  myStrip = copyStrip;
293  copyStrip = myStripList->next(copyStrip);
294  if((myStrip->getSigma()==0)||(myStrip->getDigitSig()<lowCut*myStrip->getSigma())){
295  cleanListStrip->removeStrip(myStrip);
296  }
297  }
298 }
299 //________________________________________________________________________________
309 Int_t StSsdWafer::doFindCluster(StSsdClusterControl *clusterControl, Int_t iSide)
310 {
311  StSsdStripList *CurrentStripList = 0;
312  StSsdClusterList *CurrentClusterList = 0;
313 
314  switch (iSide)
315  {
316  case 0:
317  CurrentStripList = mStripP;
318  CurrentClusterList = mClusterP;
319  break;
320  case 1:
321  CurrentStripList = mStripN;
322  CurrentClusterList = mClusterN;
323  break;
324  }
325  if(!CurrentStripList->getSize()) return 0;
326 
327  Int_t nCluster = 0;
328  Int_t atTheEnd = 0;
329 
330  doCleanListStrip(CurrentStripList);
331 
332  StSsdStrip *CurrentStrip = CurrentStripList->first();
333  StSsdStrip *ScanStrip = 0;
334  StSsdStrip *LastScanStrip = 0;
335  StSsdStrip *tmpStrip = CurrentStripList->first();
336  for(Int_t i = 0; i<CurrentStripList->getSize(); i++)
337  { tmpStrip = CurrentStripList->next(tmpStrip); }
338 
339  while(CurrentStrip)
340  {
341  if((CurrentStrip->getDigitSig()>(clusterControl->getHighCut()*CurrentStrip->getSigma()))&&(CurrentStrip->getSigma()>0))
342  {
343  LastScanStrip = 0;
344  StSsdCluster *newCluster = new StSsdCluster(CurrentClusterList->getSize());
345  nCluster++;
346  newCluster->update(CurrentStrip,1.);
347  ScanStrip = CurrentStripList->prev(CurrentStrip);
348  while(ScanStrip)
349  {
350  if(((ScanStrip->getNStrip())-((CurrentStripList->next(ScanStrip))->getNStrip()))==-1)
351  {
352  newCluster->update(ScanStrip,1.);
353  ScanStrip = CurrentStripList->prev(ScanStrip);
354  }
355  else
356  { ScanStrip = 0; }
357  }
358  ScanStrip = CurrentStripList->next(CurrentStrip);
359  while(ScanStrip)
360  {
361  if(((ScanStrip->getNStrip())-((CurrentStripList->prev(ScanStrip))->getNStrip()))==1)
362  {
363  newCluster->update(ScanStrip,1.);
364  ScanStrip = CurrentStripList->next(ScanStrip);
365  if (!ScanStrip) atTheEnd = 1;
366  }
367  else
368  {
369  LastScanStrip = ScanStrip;
370  ScanStrip = 0;
371  }
372  }
373  CurrentClusterList->addNewCluster(newCluster);
374  if(LastScanStrip)
375  { CurrentStrip = LastScanStrip; }
376  else
377  {
378  if (atTheEnd)
379  { CurrentStrip = 0; }
380  else
381  { CurrentStrip = CurrentStripList->next(CurrentStrip); }
382  }
383  }
384  else
385  { CurrentStrip = CurrentStripList->next(CurrentStrip); }
386  }
387  return nCluster;
388 }
389 //________________________________________________________________________________
395 Int_t StSsdWafer::doClusterSplitting(StSsdClusterControl *clusterControl, Int_t iSide)
396 {
397  StSsdStripList *CurrentStripList = 0;
398  StSsdClusterList *CurrentClusterList = 0;
399 
400  switch (iSide)
401  {
402  case 0:
403  CurrentStripList = mStripP;
404  CurrentClusterList = mClusterP;
405  break;
406  case 1:
407  CurrentStripList = mStripN;
408  CurrentClusterList = mClusterN;
409  break;
410  }
411 
412  Int_t ClusterListSize = CurrentClusterList->getSize();
413  if(!ClusterListSize) return 0;
414 
415  Int_t iCluster = 0;
416  StSsdCluster *CurrentCluster = CurrentClusterList->first();
417 
418  for(iCluster = 0 ; iCluster < ClusterListSize ; iCluster++)
419  {
420 
421  Int_t *ListAdc = CurrentStripList->getListAdc(CurrentCluster->getFirstStrip(),CurrentCluster->getClusterSize());
422  Int_t toBeDeleted = CurrentClusterList->splitCluster(clusterControl,CurrentCluster,ListAdc,CurrentStripList);
423  if(toBeDeleted)
424  {
425  StSsdCluster *TempCluster = CurrentCluster;
426  CurrentCluster = CurrentClusterList->next(CurrentCluster);
427  CurrentClusterList->removeCluster(TempCluster);
428  }
429  else
430  {
431  CurrentCluster = CurrentClusterList->next(CurrentCluster);
432  }
433 
434  delete [] ListAdc;
435  }
436  CurrentClusterList->renumCluster();
437  return CurrentClusterList->getSize();
438 }
439 
440 //________________________________________________________________________________
446 void StSsdWafer::doLorentzShift(ssdDimensions_st *dimensions,Float_t mShift_hole,Float_t mShift_elec)
447 {
448  Int_t rejected_sideP = 0 ;
449  Int_t rejected_sideN = 0 ;
450  Int_t iSide = 0;
451  if (Debug()) LOG_DEBUG <<Form("in doLorentzShift ShiftHole =%f ShiftElec =%f",mShift_hole,mShift_elec)<<endm;
452  rejected_sideP = doLorentzShiftSide(iSide,mShift_hole,dimensions);
453  iSide = 1;
454  rejected_sideN = doLorentzShiftSide(iSide,mShift_elec,dimensions);
455  if (Debug()) LOG_DEBUG<<Form("Rejected side P = %d Rejected side N =%d",rejected_sideP,rejected_sideN)<<endm;
456 }
457 //___________________________________________________________________________________________
458 Int_t StSsdWafer::doLorentzShiftSide(Int_t side,Float_t shift,ssdDimensions_st *dimensions){
459  StSsdClusterList *CurrentClusterList = 0;
460  Float_t pitch = dimensions[0].stripPitch;
461  Float_t waferActLength = dimensions[0].waferHalfActLength;
462  switch (side)
463  {
464  case 0:
465  CurrentClusterList = mClusterP;
466  break;
467  case 1:
468  CurrentClusterList = mClusterN;
469  break;
470  }
471  //printf("pitch=%f shift=%f ratio=%f\n",pitch,shift,shift/pitch);
472  Int_t ClusterListSize = CurrentClusterList->getSize();
473  if(!ClusterListSize) return 0;
474  Int_t iCluster = 0;
475  Int_t n_rejected = 0;
476  StSsdCluster *CurrentCluster = CurrentClusterList->first();
477 
478  for(iCluster = 0 ; iCluster < ClusterListSize ; iCluster++)
479  {
480  Float_t StripMean = CurrentCluster->getStripMean();
481  CurrentCluster->setStripMean(StripMean-(shift/pitch));
482  if(CurrentCluster->getStripMean()*pitch>waferActLength) {n_rejected++;}
483  CurrentCluster = CurrentClusterList->next(CurrentCluster);
484  }
485  return n_rejected;
486 }
487 //________________________________________________________________________________
492 Int_t StSsdWafer::doFindPackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl)
493 {
494  StSsdPackageList *currentPackageList = 0;
495  StSsdCluster *currentClusterP = 0;
496  StSsdCluster *currentClusterN = 0;
497  StSsdCluster *scanClusterP = 0;
498  StSsdCluster *scanClusterN = 0;
499  StSsdCluster *lastMatchedN = 0;
500  StSsdCluster *nextMatchedN = 0;
501 
502 
503 
504  Int_t maxMatchedInPackage = clusterControl->getClusterTreat();
505  Int_t numPackage = 0;
506  Int_t numUnMatched = 0;
507  Int_t numCurrentClusterP = 0;
508  Int_t numCurrentClusterN = 0;
509  Int_t numScanClusterP = 0;
510  Int_t numScanClusterN = 0;
511  Int_t numLastMatchedN = 0;
512  Int_t numNextMatchedN = 0;
513  Int_t matchedOk = 0;
514  Int_t keepPackage = 0;
515 
516  currentPackageList = mPackage;
517  currentClusterP = mClusterP->first();
518  currentClusterN = mClusterN->first();
519 
520  if (!mClusterP->getSize() || !mClusterN->getSize()) return 0;
521  StSsdPackage *currentPackage = new StSsdPackage(0, clusterControl);
522 
523  while (currentClusterP)
524  {
525  matchedOk = 0;
526  keepPackage = 0;
527  scanClusterP = currentClusterP ;
528  currentPackage->addNewMatched(currentClusterP, maxMatchedInPackage);
529  currentPackage->addKindPackage(numCurrentClusterP+1,0, maxMatchedInPackage);
530  scanClusterN = currentClusterN ;
531  while (scanClusterN)
532  {
533  if (geoMatched(dimensions, scanClusterP, scanClusterN))
534  {
535  matchedOk++;
536  currentPackage->addNewMatched(scanClusterN, maxMatchedInPackage);
537  currentPackage->addKindPackage(numLastMatchedN+1,1, maxMatchedInPackage);
538  lastMatchedN = scanClusterN;
539  numLastMatchedN++;
540  }
541  scanClusterN = mClusterN->next(scanClusterN);
542  }
543  if (!(numScanClusterP == mClusterP->getSize()-1))
544  {
545  scanClusterP = mClusterP->next(scanClusterP);
546  numScanClusterP++;
547  scanClusterN = lastMatchedN;
548  numScanClusterN = numLastMatchedN;
549  while (scanClusterN)
550  {
551  if (geoMatched(dimensions, scanClusterP, scanClusterN))
552  {
553  keepPackage = 1;
554  nextMatchedN = scanClusterN;
555  numScanClusterN--;
556  numNextMatchedN = numScanClusterN;
557  }
558  scanClusterN = mClusterN->prev(scanClusterN);
559  }
560  if (!keepPackage)
561  {
562  numCurrentClusterP = 0;
563  numCurrentClusterN = 0;
564  numScanClusterP = 0;
565  numScanClusterN = 0;
566  numLastMatchedN = 0;
567  if (!matchedOk)
568  {
569  numUnMatched++;
570  currentPackage->purgePackage();
571  }
572  else
573  {
574  currentClusterN = mClusterN->next(lastMatchedN);
575  if (currentPackage)
576  {
577  StSsdPackage *newPackage = new StSsdPackage(currentPackageList->getSize(), currentPackage->getSize());
578  newPackage->takeMatcheds(currentPackage);
579  currentPackageList->addNewPackage(newPackage);
580  currentPackage->purgePackage();
581  numPackage++;
582  }
583  }
584  }
585  else
586  {
587  currentClusterN = nextMatchedN;
588  numCurrentClusterP++;
589  numCurrentClusterN++;
590  numLastMatchedN = numNextMatchedN;
591  }
592  }
593  else
594  {
595  if (currentPackage)
596  {
597  StSsdPackage *newPackage = new StSsdPackage(currentPackageList->getSize(), currentPackage->getSize());
598  newPackage->takeMatcheds(currentPackage);
599  currentPackageList->addNewPackage(newPackage);
600  currentPackage->purgePackage();
601  numPackage++;
602  }
603  }
604  currentClusterP = mClusterP->next(currentClusterP);
605  }
606  delete currentPackage;
607  return numPackage;
608 }
609 //________________________________________________________________________________
610 Int_t StSsdWafer::doSolvePerfect(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl,Float_t CalibArray)
611 {
612  Int_t nPerfect = 0;
613  StSsdPackage *currentPackage = 0;
614  char *currentKind = 0;
615  currentPackage = mPackage->first();
616  while(currentPackage)
617  {
618  currentKind = currentPackage->getKind();
619  Int_t numMatched = strlen(currentKind)/2;
620  Float_t *Adc = new float[numMatched];
621  for(Int_t i=0;i<numMatched;i++)
622  Adc[i]=(currentPackage->getMatched(i))->getTotAdc();
623 // 1 *********************************************************************
624  if(!strcmp(currentKind,"1p1n"))// case (1-1) checked
625  {
626  StSsdPoint *newPoint = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 11);
627  newPoint->setFlag(100);
628  setMatcheds(dimensions, newPoint, currentPackage->getMatched(0), currentPackage->getMatched(1));
629  newPoint->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
630  mPoint->addNewPoint(newPoint);
631  nPerfect++;
632  }
633 // *********************************************************************
634  delete [] Adc;
635  currentPackage=mPackage->next(currentPackage);
636  }
637  return nPerfect;
638 }
639 //________________________________________________________________________________
640 void StSsdWafer::doStatPerfect(Int_t nPerfectPoint, StSsdClusterControl *clusterControl)
641 {
642  Float_t store = 0;
643  StSsdPoint *currentPerfect = 0;
644  currentPerfect = mPoint->first();
645  while(currentPerfect)
646  {
647  store += currentPerfect->getDe(1);
648  currentPerfect = mPoint->next(currentPerfect);
649  }
650  mPerfectMean = store/nPerfectPoint;
651 
652  store = 0;
653  currentPerfect = mPoint->first();
654  while(currentPerfect)
655  {
656  store += (currentPerfect->getDe(1)-mPerfectMean)*(currentPerfect->getDe(1)-mPerfectMean);
657  currentPerfect=mPoint->next(currentPerfect);
658  }
659  mPerfectSigma = store/nPerfectPoint;
660 }
661 //________________________________________________________________________________
662 Int_t StSsdWafer::doSolvePackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl,Float_t CalibArray)
663 {
664  Int_t nSolved = 0;
665  StSsdPackage *currentPackage = 0;
666  char *currentKind = 0;
667  currentPackage = mPackage->first();
668  while(currentPackage)
669  {
670  currentKind = currentPackage->getKind();
671  Int_t numMatched = strlen(currentKind)/2;
672  Float_t *Adc = new float[numMatched];
673  for(Int_t i=0;i<numMatched;i++) Adc[i]=(currentPackage->getMatched(i))->getTotAdc();
674 // 1 ********************************************************************
675  if(!strcmp(currentKind,"1p1n"))// case (1-1) done in doSolvePerfect
676  {
677  }
678 // 2 ********************************************************************
679  else if(!strcmp(currentKind,"1p1n2n"))// case (1-2)A final check Ok
680  {
681  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 12);
682  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
683  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2], Adc[1],CalibArray);
684  newPointA->setFlag(100);
685  mPoint->addNewPoint(newPointA);
686 
687  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 12);
688  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
689  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
690  newPointB->setFlag(100);
691  mPoint->addNewPoint(newPointB);
692  nSolved++;
693  }
694 // 3 *********************************************************************
695  else if(!strcmp(currentKind,"1p1n2p1n"))// case (1-2)AS final check Ok
696  {
697  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 21);
698  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
699  newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
700  newPointA->setFlag(100);
701  mPoint->addNewPoint(newPointA);
702 
703  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 21);
704  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
705  newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
706  newPointB->setFlag(100);
707  mPoint->addNewPoint(newPointB);
708  nSolved++;
709  }
710 // ********************************************************************
711  else if(!strcmp(currentKind,"1p1n2n3n"))// case (1-3)A checked
712  {
713  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
714  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
715  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2]-Adc[3], Adc[1],CalibArray);
716  newPointA->setFlag(100);
717  mPoint->addNewPoint(newPointA);
718 
719  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
720  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
721  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1]-Adc[3], Adc[2],CalibArray);
722  newPointB->setFlag(100);
723  mPoint->addNewPoint(newPointB);
724 
725  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
726  setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
727  newPointC->setEnergyLossCorrected(Adc[0]-Adc[1]-Adc[2], Adc[3],CalibArray);
728  newPointC->setFlag(100);
729  mPoint->addNewPoint(newPointC);
730  nSolved++;
731  }
732 // *********************************************************************
733  else if(!strcmp(currentKind,"1p1n2p1n3p1n"))// case (1-3)AS checked
734  {
735  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
736  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
737  newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2]-Adc[4],CalibArray);
738  newPointA->setFlag(100);
739  mPoint->addNewPoint(newPointA);
740 
741  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
742  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
743  newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0]-Adc[4],CalibArray);
744  newPointB->setFlag(100);
745  mPoint->addNewPoint(newPointB);
746 
747  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
748  setMatcheds(dimensions, newPointC, currentPackage->getMatched(4), currentPackage->getMatched(1));
749  newPointC->setEnergyLossCorrected(Adc[4], Adc[1]-Adc[0]-Adc[2],CalibArray);
750  newPointC->setFlag(100);
751  mPoint->addNewPoint(newPointC);
752  nSolved++;
753  }
754 // 4 *********************************************************************
755  else if(!strcmp(currentKind,"1p1n2n2p2n"))// case (2-2)A checked
756  {
757  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 221);
758  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
759  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
760  newPointA->setFlag(100);
761  mPoint->addNewPoint(newPointA);
762 
763  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 221);
764  setMatcheds(dimensions, newPointB, currentPackage->getMatched(3), currentPackage->getMatched(2));
765  newPointB->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
766  newPointB->setFlag(100);
767  mPoint->addNewPoint(newPointB);
768  nSolved++;
769  }
770 // 5 *********************************************************************
771  else if(!strcmp(currentKind,"1p1n2p1n2n"))// case (2-2)AP checked
772  {
773  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 222);
774  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
775  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
776  newPointA->setFlag(100);
777  mPoint->addNewPoint(newPointA);
778 
779  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 222);
780  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(4));
781  newPointB->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
782  newPointB->setFlag(100);
783  mPoint->addNewPoint(newPointB);
784  nSolved++;
785  }
786 // 6 *********************************************************************
787  else if(!strcmp(currentKind,"1p1n2n2p1n2n"))// case (2-2)B checked
788  {
789  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
790  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
791  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
792  //mPoint->addNewPoint(newPointA);
793 
794  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
795  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
796  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
797  //mPoint->addNewPoint(newPointB);
798 
799  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
800  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
801  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
802  //mPoint->addNewPoint(newPointC);
803 
804  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
805  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
806  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
807  //mPoint->addNewPoint(newPointD);
808 
809 // traitement propre aux space points..(probabilite)
810  Double_t setA[2], setB[2], setC[2], setD[2];
811  Double_t probAD, probBC;
812 
813  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
814  setA[1] = matchDistr(clusterControl, setA[0]);
815  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
816  setB[1] = matchDistr(clusterControl, setB[0]);
817  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
818  setC[1] = matchDistr(clusterControl, setC[0]);
819  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
820  setD[1] = matchDistr(clusterControl, setD[0]);
821  if ((setA[1]*setD[1])||(setB[1]*setC[1]))
822  {
823  Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
824  probAD = (setA[1]*setD[1])/tmp;
825  probBC = (setB[1]*setC[1])/tmp;
826  if(probAD>probBC)// we store only pointA and pointD because this configuration has the higher probability
827  {
828  mPoint->addNewPoint(newPointA);
829  mPoint->addNewPoint(newPointD);
830  }
831  else
832  {
833  mPoint->addNewPoint(newPointB);
834  mPoint->addNewPoint(newPointC);
835  }
836  }
837  else
838  {
839  probAD = 0.5;
840  probBC = 0.5;
841  mPoint->addNewPoint(newPointA);
842  mPoint->addNewPoint(newPointD);
843  mPoint->addNewPoint(newPointB);
844  mPoint->addNewPoint(newPointC);
845  }
846  newPointA->setFlag(int(100*probAD));
847  newPointB->setFlag(int(100*probBC));
848  newPointC->setFlag(int(100*probBC));
849  newPointD->setFlag(int(100*probAD));
850  nSolved++;
851 
852  }
853 // 7 *********************************************************************
854  else if(!strcmp(currentKind,"1p1n2n2p2n3n"))// case (2-3)A checked
855  {
856  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
857  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
858  newPointA->setFlag(100);
859  //mPoint->addNewPoint(newPointA);
860 
861  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
862  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
863  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
864  //mPoint->addNewPoint(newPointB);
865 
866  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
867  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
868  newPointC->setEnergyLossCorrected(Adc[3]-Adc[5], Adc[2],CalibArray);
869  //mPoint->addNewPoint(newPointC);
870 
871  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
872  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(5));
873  newPointD->setFlag(100);
874  //mPoint->addNewPoint(newPointD);
875 
876 // traitement propre aux space points..(probabilite)
877  Double_t setA[2], setD[2];
878  Double_t setAB[2], setCD[2];
879  Double_t probABD, probACD;
880 
881  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
882  setA[1] = matchDistr(clusterControl, setA[0]);
883  setAB[0] = (Adc[0] - (Adc[1]+Adc[2]))/sqrt(2.0);
884  setAB[1] = matchDistr(clusterControl, setAB[0]);
885  setCD[0] = (Adc[3] - (Adc[2]+Adc[5]))/sqrt(2.0);
886  setCD[1] = matchDistr(clusterControl, setCD[0]);
887  setD[0] = (Adc[3] - Adc[5])/sqrt(2.0);
888  setD[1] = matchDistr(clusterControl, setD[0]);
889  Double_t tmp = 3e-33+(setAB[1]*setD[1]+setA[1]*setCD[1]+1e-10);
890  probABD = (setAB[1]*setD[1])/tmp;
891  probACD = (setA[1]*setCD[1])/tmp;
892  newPointB->setFlag(int(100*probABD));
893  newPointC->setFlag(int(100*probACD));
894  if (probABD > probACD)
895  {
896  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
897  newPointD->setEnergyLossCorrected(Adc[3], Adc[5],CalibArray);
898  mPoint->addNewPoint(newPointA);
899  mPoint->addNewPoint(newPointB);
900  mPoint->addNewPoint(newPointD);
901  }
902  else
903  {
904  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
905  newPointD->setEnergyLossCorrected(Adc[3]-Adc[2], Adc[5],CalibArray);
906  mPoint->addNewPoint(newPointA);
907  mPoint->addNewPoint(newPointB);
908  mPoint->addNewPoint(newPointC);
909  }
910  nSolved++;
911  }
912 // 8 *********************************************************************
913  else if(!strcmp(currentKind,"1p1n2p1n2n3p2n"))// case (2-3)AP checked
914  {
915  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
916  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
917  newPointA->setFlag(100);
918  //mPoint->addNewPoint(newPointA);
919 
920  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
921  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
922  newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
923  //mPoint->addNewPoint(newPointB);
924 
925  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
926  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
927  newPointC->setEnergyLossCorrected(Adc[2], Adc[4]-Adc[5],CalibArray);
928  //mPoint->addNewPoint(newPointC);
929 
930  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
931  setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(4));
932  newPointD->setFlag(100);
933  //mPoint->addNewPoint(newPointD);
934 
935 // traitement propre aux space points..(probabilite)
936  Double_t setA[2], setD[2];
937  Double_t setAB[2], setCD[2];
938  Double_t probABD, probACD;
939 
940  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
941  setA[1] = matchDistr(clusterControl, setA[0]);
942  setAB[0] = (Adc[0] + Adc[2] - Adc[1])/sqrt(2.0);
943  setAB[1] = matchDistr(clusterControl, setAB[0]);
944  setCD[0] = (Adc[2] + Adc[5] - Adc[4])/sqrt(2.0);
945  setCD[1] = matchDistr(clusterControl, setCD[0]);
946  setD[0] = (Adc[5] - Adc[4])/sqrt(2.0);
947  setD[1] = matchDistr(clusterControl, setD[0]);
948  Double_t tmp = 3e-33+(setAB[1]*setD[1]+setA[1]*setCD[1]);
949  probABD = (setAB[1]*setD[1])/tmp;
950  probACD = (setA[1]*setCD[1])/tmp;
951  newPointB->setFlag(int(100*probABD));
952  newPointC->setFlag(int(100*probACD));
953  if (probABD > probACD)
954  {
955  newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
956  newPointD->setEnergyLossCorrected(Adc[5], Adc[4],CalibArray);
957  mPoint->addNewPoint(newPointA);
958  mPoint->addNewPoint(newPointB);
959  mPoint->addNewPoint(newPointD);
960  }
961  else
962  {
963  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
964  newPointD->setEnergyLossCorrected(Adc[5], Adc[4]-Adc[2],CalibArray);
965  mPoint->addNewPoint(newPointA);
966  mPoint->addNewPoint(newPointB);
967  mPoint->addNewPoint(newPointC);
968  }
969  nSolved++;
970  }
971 // 9 *********************************************************************
972  else if(!strcmp(currentKind,"1p1n2n3n2p2n3n"))// case (2-3)B
973  {
974  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
975  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
976  newPointA->setFlag(100);
977  //mPoint->addNewPoint(newPointA);
978 
979  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
980  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
981  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
982  //mPoint->addNewPoint(newPointB);
983 
984  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
985  setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
986  newPointC->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[3],CalibArray);
987  //mPoint->addNewPoint(newPointC);
988 
989  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
990  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
991  //mPoint->addNewPoint(newPointD);
992 
993  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
994  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(3));
995  //mPoint->addNewPoint(newPointE);
996 
997 // traitement propre aux space points..(probabilite)
998  Double_t setA[2], setD[2], setE[2];
999  Double_t setAB[2], setAC[2], setDE[2];
1000  Double_t probABE, probACD, probADE;
1001 
1002  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1003  setA[1] = matchDistr(clusterControl, setA[0]);
1004  setAB[0] = (Adc[0] - (Adc[1] + Adc[2]))/sqrt(2.0);
1005  setAB[1] = matchDistr(clusterControl, setAB[0]);
1006  setAC[0] = (Adc[0] - (Adc[1] + Adc[3]))/sqrt(2.0);
1007  setAC[1] = matchDistr(clusterControl, setAC[0]);
1008  setDE[0] = (Adc[4] - (Adc[2] + Adc[3]))/sqrt(2.0);
1009  setDE[1] = matchDistr(clusterControl, setDE[0]);
1010  setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
1011  setD[1] = matchDistr(clusterControl, setD[0]);
1012  setE[0] = (Adc[4] - Adc[3])/sqrt(2.0);
1013  setE[1] = matchDistr(clusterControl, setE[0]);
1014  Double_t tmp = 3e-33+(setAB[1]*setE[1]+setAC[1]*setD[1]+setA[1]*setDE[1]);
1015  probABE = (setAB[1]*setE[1])/tmp;
1016  probACD = (setAC[1]*setD[1])/tmp;
1017  probADE = (setA[1]*setDE[1])/tmp;
1018  newPointB->setFlag(int(100*probABE));
1019  newPointC->setFlag(int(100*probACD));
1020  newPointD->setFlag(int(100*(probACD+probADE)));
1021  newPointE->setFlag(int(100*(probABE+probADE)));
1022  if ((probABE > probACD)&&(probABE > probADE))
1023  {
1024  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
1025  newPointE->setEnergyLossCorrected(Adc[4],Adc[3],CalibArray);
1026  mPoint->addNewPoint(newPointA);
1027  mPoint->addNewPoint(newPointB);
1028  mPoint->addNewPoint(newPointE);
1029 
1030  }
1031  else if ((probACD > probABE)&&(probACD > probADE))
1032  {
1033  newPointA->setEnergyLossCorrected(Adc[0]-Adc[3],Adc[1],CalibArray);
1034  newPointD->setEnergyLossCorrected(Adc[4],Adc[2],CalibArray);
1035  mPoint->addNewPoint(newPointA);
1036  mPoint->addNewPoint(newPointC);
1037  mPoint->addNewPoint(newPointD);
1038  }
1039  else if ((probADE > probABE)&&(probADE > probACD))
1040  {
1041  newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1042  newPointD->setEnergyLossCorrected(Adc[4]-Adc[3],Adc[2],CalibArray);
1043  newPointE->setEnergyLossCorrected(Adc[4]-Adc[2],Adc[3],CalibArray);
1044  mPoint->addNewPoint(newPointA);
1045  mPoint->addNewPoint(newPointB);
1046  mPoint->addNewPoint(newPointE);
1047  }
1048  nSolved++;
1049  }
1050 // 10 *********************************************************************
1051  else if(!strcmp(currentKind,"1p1n2p1n2n3p1n2n"))// case (3-2)BP
1052  {
1053  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1054  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1055  newPointA->setFlag(100);
1056  //mPoint->addNewPoint(newPointA);
1057 
1058  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1059  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
1060  newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
1061  //mPoint->addNewPoint(newPointB);
1062 
1063  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1064  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1065  //mPoint->addNewPoint(newPointC);
1066 
1067  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1068  setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(1));
1069  newPointD->setEnergyLossCorrected(Adc[5], Adc[1]-Adc[0],CalibArray);
1070  //mPoint->addNewPoint(newPointD);
1071 
1072  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1073  setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(4));
1074  //mPoint->addNewPoint(newPointE);
1075 
1076 // traitement propre aux space points..(probabilite)
1077  Double_t setA[2], setC[2], setE[2];
1078  Double_t setAB[2], setAD[2], setCE[2];
1079  Double_t probABE, probACD, probACE;
1080 
1081  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1082  setA[1] = matchDistr(clusterControl, setA[0]);
1083  setAB[0] = (Adc[0] + Adc[2] - Adc[1])/sqrt(2.0);
1084  setAB[1] = matchDistr(clusterControl, setAB[0]);
1085  setAD[0] = (Adc[0] + Adc[5] - Adc[1])/sqrt(2.0);
1086  setAD[1] = matchDistr(clusterControl, setAD[0]);
1087  setCE[0] = (Adc[2] + Adc[5] + Adc[4])/sqrt(2.0);
1088  setCE[1] = matchDistr(clusterControl, setCE[0]);
1089  setC[0] = (Adc[2] - Adc[4])/sqrt(2.0);
1090  setC[1] = matchDistr(clusterControl, setC[0]);
1091  setE[0] = (Adc[5] - Adc[4])/sqrt(2.0);
1092  setE[1] = matchDistr(clusterControl, setE[0]);
1093  Double_t tmp = 3e-33+(setAB[1]*setE[1]+setAD[1]*setC[1]+setA[1]*setCE[1]);
1094  probABE = (setAB[1]*setE[1])/tmp;
1095  probACD = (setAD[1]*setC[1])/tmp;
1096  probACE = (setA[1]*setCE[1])/tmp;
1097  newPointB->setFlag(int(100*probABE));
1098  newPointC->setFlag(int(100*(probACD+probACE)));
1099  newPointD->setFlag(int(100*probACD));
1100  newPointE->setFlag(int(100*(probABE+probACE)));
1101  if ((probABE > probACD)&&(probABE > probACE))
1102  {
1103  newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[2],CalibArray);
1104  newPointE->setEnergyLossCorrected(Adc[5],Adc[4],CalibArray);
1105  mPoint->addNewPoint(newPointA);
1106  mPoint->addNewPoint(newPointB);
1107  mPoint->addNewPoint(newPointE);
1108  }
1109  else if ((probACD > probABE)&&(probACD > probACE))
1110  {
1111  newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[5],CalibArray);
1112  newPointC->setEnergyLossCorrected(Adc[2],Adc[4],CalibArray);
1113  mPoint->addNewPoint(newPointA);
1114  mPoint->addNewPoint(newPointC);
1115  mPoint->addNewPoint(newPointD);
1116  }
1117  else if ((probACE > probABE)&&(probACE > probACD))
1118  {
1119  newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1120  newPointC->setEnergyLossCorrected(Adc[2],Adc[4]-Adc[5],CalibArray);
1121  newPointE->setEnergyLossCorrected(Adc[5],Adc[4]-Adc[2],CalibArray);
1122  mPoint->addNewPoint(newPointA);
1123  mPoint->addNewPoint(newPointB);
1124  mPoint->addNewPoint(newPointE);
1125  }
1126  nSolved++;
1127  }
1128 // 11 ********************************************************************
1129  else if(!strcmp(currentKind,"1p1n2n2p1n2n3n"))// case (2-3)BS
1130  {
1131  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1132  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1133  //mPoint->addNewPoint(newPointA);
1134 
1135  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1136  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1137  //mPoint->addNewPoint(newPointB);
1138 
1139  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1140  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1141  newPointC->setEnergyLossCorrected(Adc[3]-Adc[6],Adc[1],CalibArray);
1142  //mPoint->addNewPoint(newPointC);
1143 
1144  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1145  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1146  newPointD->setEnergyLossCorrected(Adc[3]-Adc[6], Adc[2],CalibArray);
1147  //mPoint->addNewPoint(newPointD);
1148 
1149  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1150  setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
1151  newPointE->setFlag(100);
1152  //mPoint->addNewPoint(newPointE);
1153 
1154 // traitement propre aux space points..(probabilite)
1155  Double_t setA[2], setB[2], setE[2];
1156  Double_t setAB[2], setCE[2], setDE[2];
1157  Double_t probABE, probADE, probBCE;
1158 
1159  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1160  setA[1] = matchDistr(clusterControl, setA[0]);
1161  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1162  setB[1] = matchDistr(clusterControl, setB[0]);
1163  setAB[0] = (Adc[0] - (Adc[1] + Adc[2]))/sqrt(2.0);
1164  setAB[1] = matchDistr(clusterControl, setAB[0]);
1165  setCE[0] = (Adc[3] - (Adc[1] - Adc[6]))/sqrt(2.0);
1166  setCE[1] = matchDistr(clusterControl, setCE[0]);
1167  setDE[0] = (Adc[3] - (Adc[2] + Adc[6]))/sqrt(2.0);
1168  setDE[1] = matchDistr(clusterControl, setDE[0]);
1169  setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
1170  setE[1] = matchDistr(clusterControl, setE[0]);
1171  Double_t tmp = 3e-33+(setAB[1]*setE[1]+setA[1]*setDE[1]+setB[1]*setCE[1]);
1172  probABE = (setAB[1]*setE[1])/tmp;
1173  probADE = (setA[1]*setDE[1])/tmp;
1174  probBCE = (setB[1]*setCE[1])/tmp;
1175  newPointA->setFlag(int(100*(probABE+probADE)));
1176  newPointB->setFlag(int(100*(probABE+probBCE)));
1177  newPointC->setFlag(int(100*probBCE));
1178  newPointD->setFlag(int(100*probADE));
1179  if ((probABE > probADE)&&(probABE > probBCE))
1180  {
1181  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
1182  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1],Adc[2],CalibArray);
1183  newPointE->setEnergyLossCorrected(Adc[3],Adc[6],CalibArray);
1184  mPoint->addNewPoint(newPointA);
1185  mPoint->addNewPoint(newPointB);
1186  mPoint->addNewPoint(newPointE);
1187  }
1188  else if ((probADE > probABE)&&(probADE > probBCE))
1189  {
1190  newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1191  newPointE->setEnergyLossCorrected(Adc[3]-Adc[2],Adc[6],CalibArray);
1192  mPoint->addNewPoint(newPointA);
1193  mPoint->addNewPoint(newPointD);
1194  mPoint->addNewPoint(newPointE);
1195  }
1196  else if ((probBCE > probABE)&&(probBCE > probADE))
1197  {
1198  newPointB->setEnergyLossCorrected(Adc[0],Adc[2],CalibArray);
1199  newPointE->setEnergyLossCorrected(Adc[3]-Adc[1],Adc[6],CalibArray);
1200  mPoint->addNewPoint(newPointB);
1201  mPoint->addNewPoint(newPointC);
1202  mPoint->addNewPoint(newPointE);
1203  }
1204  nSolved++;
1205  }
1206 // 12 ********************************************************************
1207  else if(!strcmp(currentKind,"1p1n2n2p1n2n3p2n"))// case (3-2)BSP
1208  {
1209  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1210  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1211  //mPoint->addNewPoint(newPointA);
1212 
1213  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1214  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1215  newPointB->setEnergyLossCorrected(Adc[0]-Adc[6], Adc[2],CalibArray);
1216  //mPoint->addNewPoint(newPointB);
1217 
1218  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1219  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1220  //mPoint->addNewPoint(newPointC);
1221 
1222  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1223  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1224  newPointD->setEnergyLossCorrected(Adc[3]-Adc[6], Adc[2],CalibArray);
1225  //mPoint->addNewPoint(newPointD);
1226 
1227  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1228  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(2));
1229  newPointE->setFlag(100);
1230  //mPoint->addNewPoint(newPointE);
1231 
1232 // traitement propre aux space points..(probabilite)
1233  Double_t setA[2], setC[2], setE[2];
1234  Double_t setAC[2], setBE[2], setDE[2];
1235  Double_t probACE, probADE, probBCE;
1236 
1237  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1238  setA[1] = matchDistr(clusterControl, setA[0]);
1239  setAC[0] = (Adc[0] + Adc[3] - Adc[1])/sqrt(2.0);
1240  setAC[1] = matchDistr(clusterControl, setAC[0]);
1241  setBE[0] = (Adc[0] + Adc[6] - Adc[2])/sqrt(2.0);
1242  setBE[1] = matchDistr(clusterControl, setBE[0]);
1243  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1244  setC[1] = matchDistr(clusterControl, setC[0]);
1245  setDE[0] = (Adc[3] + Adc[6] - Adc[2])/sqrt(2.0);
1246  setDE[1] = matchDistr(clusterControl, setDE[0]);
1247  setE[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1248  setE[1] = matchDistr(clusterControl, setE[0]);
1249  Double_t tmp = 3e-33+(setAC[1]*setE[1]+setA[1]*setDE[1]+setBE[1]*setC[1]);
1250  probACE = (setAC[1]*setE[1])/tmp;
1251  probADE = (setA[1]*setDE[1])/tmp;
1252  probBCE = (setBE[1]*setC[1])/tmp;
1253  newPointA->setFlag(int(100*(probACE+probADE)));
1254  newPointB->setFlag(int(100*probBCE));
1255  newPointC->setFlag(int(100*(probACE+probBCE)));
1256  newPointD->setFlag(int(100*probADE));
1257  if ((probACE > probADE)&&(probACE > probBCE))
1258  {
1259  newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[3],CalibArray);
1260  newPointC->setEnergyLossCorrected(Adc[3],Adc[1]-Adc[0],CalibArray);
1261  newPointE->setEnergyLossCorrected(Adc[6],Adc[2],CalibArray);
1262  mPoint->addNewPoint(newPointA);
1263  mPoint->addNewPoint(newPointC);
1264  mPoint->addNewPoint(newPointE);
1265  }
1266  else if ((probADE > probACE)&&(probADE > probBCE))
1267  {
1268  newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1269  newPointE->setEnergyLossCorrected(Adc[6],Adc[2]-Adc[3],CalibArray);
1270  mPoint->addNewPoint(newPointA);
1271  mPoint->addNewPoint(newPointD);
1272  mPoint->addNewPoint(newPointE);
1273  }
1274  else if ((probBCE > probACE)&&(probBCE > probADE))
1275  {
1276  newPointB->setEnergyLossCorrected(Adc[3],Adc[1],CalibArray);
1277  newPointE->setEnergyLossCorrected(Adc[6],Adc[2]-Adc[0],CalibArray);
1278  mPoint->addNewPoint(newPointB);
1279  mPoint->addNewPoint(newPointC);
1280  mPoint->addNewPoint(newPointE);
1281  }
1282  nSolved++;
1283  }
1284 // 13 ********************************************************************
1285  else if(!strcmp(currentKind,"1p1n2p1n2n3n"))// case (2-3)C checked
1286  {
1287  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1288  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1289  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1290  newPointA->setFlag(100);
1291  mPoint->addNewPoint(newPointA);
1292 
1293  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1294  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1295  newPointC->setEnergyLossCorrected(Adc[2]-Adc[5], Adc[4],CalibArray);
1296  newPointC->setFlag(100);
1297  mPoint->addNewPoint(newPointC);
1298 
1299  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1300  setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1301  newPointD->setEnergyLossCorrected(Adc[2]-Adc[4], Adc[5],CalibArray);
1302  newPointD->setFlag(100);
1303  mPoint->addNewPoint(newPointD);
1304 
1305  nSolved++;
1306  }
1307 // 14 ********************************************************************
1308  else if(!strcmp(currentKind,"1p1n2n2p2n3p2n"))// case (3-2)CP checked
1309  {
1310  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1311  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1312  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1313  newPointA->setFlag(100);
1314  mPoint->addNewPoint(newPointA);
1315 
1316  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1317  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1318  newPointC->setEnergyLossCorrected(Adc[3], Adc[2]-Adc[5],CalibArray);
1319  newPointC->setFlag(100);
1320  mPoint->addNewPoint(newPointC);
1321 
1322  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1323  setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(2)); // Fixed thanks to Lilian !
1324  newPointD->setEnergyLossCorrected(Adc[5], Adc[2]-Adc[3],CalibArray);
1325  newPointD->setFlag(100);
1326  mPoint->addNewPoint(newPointD);
1327 
1328  nSolved++;
1329  }
1330 // 15 ********************************************************************
1331  else if(!strcmp(currentKind,"1p1n2n3n2p3n"))// case (2-3)CS checked
1332  {
1333  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1334  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1335  newPointA->setEnergyLossCorrected(Adc[0]-Adc[2], Adc[1],CalibArray);
1336  newPointA->setFlag(100);
1337  mPoint->addNewPoint(newPointA);
1338 
1339  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1340  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1341  newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
1342  newPointB->setFlag(100);
1343  mPoint->addNewPoint(newPointB);
1344 
1345  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1346  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(5));
1347  newPointD->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
1348  newPointD->setFlag(100);
1349  mPoint->addNewPoint(newPointD);
1350 
1351  nSolved++;
1352  }
1353 // 16 ********************************************************************
1354  else if(!strcmp(currentKind,"1p1n2p1n3p1n2n"))// case (3-2)CPS checked
1355  {
1356  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1357  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1358  newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
1359  newPointA->setFlag(100);
1360  mPoint->addNewPoint(newPointA);
1361 
1362  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1363  setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
1364  newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
1365  newPointB->setFlag(100);
1366  mPoint->addNewPoint(newPointB);
1367 
1368  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1369  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(6));
1370  newPointD->setEnergyLossCorrected(Adc[4], Adc[6],CalibArray);
1371  newPointD->setFlag(100);
1372  mPoint->addNewPoint(newPointD);
1373 
1374  nSolved++;
1375  }
1376 // 17 ********************************************************************
1377  else if(!strcmp(currentKind,"1p1n2n3n2p1n2n3n"))// case (2-3)D
1378  {
1379  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1380  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1381  mPoint->addNewPoint(newPointA);
1382 
1383  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1384  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1385  mPoint->addNewPoint(newPointB);
1386 
1387  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1388  setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
1389  mPoint->addNewPoint(newPointC);
1390 
1391  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1392  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
1393  mPoint->addNewPoint(newPointD);
1394 
1395  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1396  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
1397  mPoint->addNewPoint(newPointE);
1398 
1399  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1400  setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
1401  mPoint->addNewPoint(newPointF);
1402 
1403 // traitement propre aux space points..(probabilite)
1404  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2];
1405  Double_t setAB[2], setAC[2], setBC[2], setDE[2], setDF[2], setEF[2];
1406  Double_t prob[6];
1407 
1408  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1409  setA[1] = matchDistr(clusterControl, setA[0]);
1410  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1411  setB[1] = matchDistr(clusterControl, setB[0]);
1412  setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
1413  setC[1] = matchDistr(clusterControl, setC[0]);
1414  setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
1415  setD[1] = matchDistr(clusterControl, setD[0]);
1416  setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
1417  setE[1] = matchDistr(clusterControl, setE[0]);
1418  setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
1419  setF[1] = matchDistr(clusterControl, setF[0]);
1420  setAB[0] = (Adc[0] - Adc[1] - Adc[2])/sqrt(2.0);
1421  setAB[1] = matchDistr(clusterControl, setAB[0]);
1422  setAC[0] = (Adc[0] - Adc[1] - Adc[3])/sqrt(2.0);
1423  setAC[1] = matchDistr(clusterControl, setAC[0]);
1424  setBC[0] = (Adc[0] - Adc[2] - Adc[3])/sqrt(2.0);
1425  setBC[1] = matchDistr(clusterControl, setBC[0]);
1426  setDE[0] = (Adc[4] - Adc[1] - Adc[2])/sqrt(2.0);
1427  setDE[1] = matchDistr(clusterControl, setDE[0]);
1428  setDF[0] = (Adc[4] - Adc[1] - Adc[3])/sqrt(2.0);
1429  setDF[1] = matchDistr(clusterControl, setDF[0]);
1430  setEF[0] = (Adc[4] - Adc[2] - Adc[3])/sqrt(2.0);
1431  setEF[1] = matchDistr(clusterControl, setEF[0]);
1432  Double_t tmp = 3e-33+(setAC[1]*setE[1]+setAB[1]*setF[1]+setBC[1]*setD[1]+setDF[1]*setB[1]+setDE[1]*setC[1]+setEF[1]*setA[1]);
1433  prob[0] = (setAC[1]*setE[1]+setAB[1]*setF[1]+setEF[1]*setA[1])/tmp;
1434  prob[1] = (setAB[1]*setF[1]+setBC[1]*setD[1]+setDF[1]*setB[1])/tmp;
1435  prob[2] = (setAC[1]*setE[1]+setBC[1]*setD[1]+setDE[1]*setC[1])/tmp;
1436  prob[3] = (setBC[1]*setD[1]+setDF[1]*setB[1]+setDE[1]*setC[1])/tmp;
1437  prob[4] = (setAC[1]*setE[1]+setDE[1]*setC[1]+setEF[1]*setA[1])/tmp;
1438  prob[5] = (setAB[1]*setF[1]+setDF[1]*setB[1]+setEF[1]*setA[1])/tmp;
1439  newPointA->setFlag(int(100*prob[0]));
1440  newPointB->setFlag(int(100*prob[1]));
1441  newPointC->setFlag(int(100*prob[2]));
1442  newPointD->setFlag(int(100*prob[3]));
1443  newPointE->setFlag(int(100*prob[4]));
1444  newPointF->setFlag(int(100*prob[5]));
1445  nSolved++;
1446  }
1447 // 18 ********************************************************************
1448  else if(!strcmp(currentKind,"1p1n2n2p1n2n3p1n2n"))// case (3-2)DP
1449  {
1450  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1451  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1452  mPoint->addNewPoint(newPointA);
1453 
1454  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1455  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1456  mPoint->addNewPoint(newPointB);
1457 
1458  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1459  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1460  mPoint->addNewPoint(newPointC);
1461 
1462  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1463  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1464  mPoint->addNewPoint(newPointD);
1465 
1466  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1467  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(1));
1468  mPoint->addNewPoint(newPointE);
1469 
1470  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1471  setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(2));
1472  mPoint->addNewPoint(newPointF);
1473 
1474 // traitement propre aux space points..(probabilite)
1475  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2];
1476  Double_t setAC[2], setBD[2], setAE[2], setBF[2], setCE[2], setDF[2];
1477  Double_t prob[6];
1478 
1479  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1480  setA[1] = matchDistr(clusterControl, setA[0]);
1481  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1482  setB[1] = matchDistr(clusterControl, setB[0]);
1483  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1484  setC[1] = matchDistr(clusterControl, setC[0]);
1485  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1486  setD[1] = matchDistr(clusterControl, setD[0]);
1487  setE[0] = (Adc[6] - Adc[1])/sqrt(2.0);
1488  setE[1] = matchDistr(clusterControl, setE[0]);
1489  setF[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1490  setF[1] = matchDistr(clusterControl, setF[0]);
1491  setAC[0] = (Adc[0] + Adc[3] - Adc[1])/sqrt(2.0);
1492  setAC[1] = matchDistr(clusterControl, setAC[0]);
1493  setBD[0] = (Adc[0] + Adc[3] - Adc[2])/sqrt(2.0);
1494  setBD[1] = matchDistr(clusterControl, setBD[0]);
1495  setAE[0] = (Adc[0] + Adc[6] - Adc[1])/sqrt(2.0);
1496  setAE[1] = matchDistr(clusterControl, setAE[0]);
1497  setBF[0] = (Adc[0] + Adc[6] - Adc[2])/sqrt(2.0);
1498  setBF[1] = matchDistr(clusterControl, setBF[0]);
1499  setCE[0] = (Adc[3] + Adc[6] - Adc[1])/sqrt(2.0);
1500  setCE[1] = matchDistr(clusterControl, setCE[0]);
1501  setDF[0] = (Adc[3] + Adc[6] - Adc[2])/sqrt(2.0);
1502  setDF[1] = matchDistr(clusterControl, setDF[0]);
1503  Double_t tmp = 3e-33+(setAC[1]*setF[1]+setAE[1]*setD[1]+setDF[1]*setA[1]+setCE[1]*setB[1]+setBD[1]*setE[1]+setBF[1]*setC[1]);
1504  prob[0] = (setAC[1]*setF[1]+setAE[1]*setD[1]+setDF[1]*setA[1])/tmp;
1505  prob[1] = (setCE[1]*setB[1]+setBD[1]*setE[1]+setBF[1]*setC[1])/tmp;
1506  prob[2] = (setAC[1]*setF[1]+setCE[1]*setB[1]+setBF[1]*setC[1])/tmp;
1507  prob[3] = (setAE[1]*setD[1]+setCE[1]*setB[1]+setBD[1]*setE[1])/tmp;
1508  prob[4] = (setAE[1]*setD[1]+setDF[1]*setA[1]+setBD[1]*setE[1])/tmp;
1509  prob[5] = (setAC[1]*setF[1]+setDF[1]*setA[1]+setBF[1]*setC[1])/tmp;
1510  newPointA->setFlag(int(100*prob[0]));
1511  newPointB->setFlag(int(100*prob[1]));
1512  newPointC->setFlag(int(100*prob[2]));
1513  newPointD->setFlag(int(100*prob[3]));
1514  newPointE->setFlag(int(100*prob[4]));
1515  newPointF->setFlag(int(100*prob[5]));
1516  nSolved++;
1517  }
1518 // 19 ********************************************************************
1519  else if(!strcmp(currentKind,"1p1n2n2p2n3n3p3n"))// case (3-3)A
1520  {
1521  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1522  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1523  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1524  newPointA->setFlag(100);
1525  mPoint->addNewPoint(newPointA);
1526 
1527  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1528  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1529  newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1530  newPointC->setFlag(100);
1531  mPoint->addNewPoint(newPointC);
1532 
1533  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1534  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(5));
1535  newPointE->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1536  newPointE->setFlag(100);
1537  mPoint->addNewPoint(newPointE);
1538 
1539  nSolved++;
1540  }
1541 // 20 ********************************************************************
1542  else if(!strcmp(currentKind,"1p1n2p1n2n3p2n3n"))// case (3-3)AP
1543  {
1544  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1545  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1546  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1547  newPointA->setFlag(100);
1548  mPoint->addNewPoint(newPointA);
1549 
1550  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1551  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1552  newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1553  newPointC->setFlag(100);
1554  mPoint->addNewPoint(newPointC);
1555 
1556  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1557  setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(7));
1558  newPointE->setEnergyLossCorrected(Adc[5], Adc[7],CalibArray);
1559  newPointE->setFlag(100);
1560  mPoint->addNewPoint(newPointE);
1561 
1562  nSolved++;
1563  }
1564 // 21 *********************************************************************
1565  else if(!strcmp(currentKind,"1p1n2n2p2n3n3p2n3n"))// case (3-3)B
1566  {
1567  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1568  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1569  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1570  newPointA->setFlag(100);
1571  //mPoint->addNewPoint(newPointA);
1572 
1573  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1574  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1575  newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1576  //mPoint->addNewPoint(newPointC);
1577 
1578  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1579  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(5));
1580  newPointD->setEnergyLossCorrected(Adc[3], Adc[5],CalibArray);
1581  //mPoint->addNewPoint(newPointD);
1582 
1583  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1584  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(2));
1585  newPointE->setEnergyLossCorrected(Adc[6], Adc[2],CalibArray);
1586  //mPoint->addNewPoint(newPointE);
1587 
1588  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1589  setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(5));
1590  newPointF->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1591  //mPoint->addNewPoint(newPointF);
1592 
1593 // traitement propre aux space points..(probabilite)
1594  Double_t setC[2], setD[2], setE[2], setF[2];
1595  Double_t probACF, probADE;
1596 
1597  setC[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1598  setC[1] = matchDistr(clusterControl, setC[0]);
1599  setD[0] = (Adc[3] - Adc[5])/sqrt(2.0);
1600  setD[1] = matchDistr(clusterControl, setD[0]);
1601  setE[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1602  setE[1] = matchDistr(clusterControl, setE[0]);
1603  setF[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1604  setF[1] = matchDistr(clusterControl, setF[0]);
1605  Double_t tmp = 3e-33+ setC[1]*setF[1]+setD[1]*setE[1];
1606  probACF = (setC[1]*setF[1])/tmp;
1607  probADE = (setD[1]*setE[1])/tmp;
1608  if(probACF>probADE)
1609  {
1610  mPoint->addNewPoint(newPointA);
1611  mPoint->addNewPoint(newPointC);
1612  mPoint->addNewPoint(newPointF);
1613  }
1614  else
1615  {
1616  mPoint->addNewPoint(newPointA);
1617  mPoint->addNewPoint(newPointD);
1618  mPoint->addNewPoint(newPointE);
1619  }
1620  newPointC->setFlag(int(100*probACF));
1621  newPointD->setFlag(int(100*probADE));
1622  newPointE->setFlag(int(100*probADE));
1623  newPointF->setFlag(int(100*probACF));
1624  nSolved++;
1625  }
1626 // 22 *********************************************************************
1627  else if(!strcmp(currentKind,"1p1n2p1n2n3n3p2n3n"))// case (3-3)BP
1628  {
1629  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1630  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1631  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1632  newPointA->setFlag(100);
1633  //mPoint->addNewPoint(newPointA);
1634 
1635  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1636  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1637  newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1638  //mPoint->addNewPoint(newPointC);
1639 
1640  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1641  setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1642  newPointD->setEnergyLossCorrected(Adc[2], Adc[5],CalibArray);
1643  //mPoint->addNewPoint(newPointD);
1644 
1645  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1646  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(4));
1647  newPointE->setEnergyLossCorrected(Adc[6], Adc[4],CalibArray);
1648  //mPoint->addNewPoint(newPointE);
1649 
1650  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1651  setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(5));
1652  newPointF->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1653  //mPoint->addNewPoint(newPointF);
1654 
1655 // traitement propre aux space points..(probabilite)
1656  Double_t setC[2], setD[2], setE[2], setF[2];
1657  Double_t probACF, probADE;
1658 
1659  setC[0] = (Adc[2] - Adc[4])/sqrt(2.0);
1660  setC[1] = matchDistr(clusterControl, setC[0]);
1661  setD[0] = (Adc[2] - Adc[5])/sqrt(2.0);
1662  setD[1] = matchDistr(clusterControl, setD[0]);
1663  setE[0] = (Adc[6] - Adc[4])/sqrt(2.0);
1664  setE[1] = matchDistr(clusterControl, setE[0]);
1665  setF[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1666  setF[1] = matchDistr(clusterControl, setF[0]);
1667  Double_t tmp = 3e-33+ setC[1]*setF[1]+setD[1]*setE[1];
1668  probACF = (setC[1]*setF[1])/tmp;
1669  probADE = (setD[1]*setE[1])/tmp;
1670  if(probACF>probADE)
1671  {
1672  mPoint->addNewPoint(newPointA);
1673  mPoint->addNewPoint(newPointC);
1674  mPoint->addNewPoint(newPointF);
1675  }
1676  else
1677  {
1678  mPoint->addNewPoint(newPointA);
1679  mPoint->addNewPoint(newPointD);
1680  mPoint->addNewPoint(newPointE);
1681  }
1682  newPointC->setFlag(int(100*probACF));
1683  newPointD->setFlag(int(100*probADE));
1684  newPointE->setFlag(int(100*probADE));
1685  newPointF->setFlag(int(100*probACF));
1686  nSolved++;
1687  }
1688 // 23 *********************************************************************
1689  else if(!strcmp(currentKind,"1p1n2n2p1n2n3p2n3n"))// case (3-3)BS
1690  {
1691  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1692  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1693  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1694  //mPoint->addNewPoint(newPointA);
1695 
1696  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1697  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1698  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1699  //mPoint->addNewPoint(newPointB);
1700 
1701  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1702  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1703  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
1704  //mPoint->addNewPoint(newPointC);
1705 
1706  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1707  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1708  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1709  //mPoint->addNewPoint(newPointD);
1710 
1711  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1712  setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(8));
1713  newPointF->setEnergyLossCorrected(Adc[6], Adc[8],CalibArray);
1714  newPointF->setFlag(100);
1715  //mPoint->addNewPoint(newPointF);
1716 
1717 // traitement propre aux space points..(probabilite)
1718  Double_t setA[2], setB[2], setC[2], setD[2];
1719  Double_t probADF, probBCF;
1720 
1721  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1722  setA[1] = matchDistr(clusterControl, setA[0]);
1723  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1724  setB[1] = matchDistr(clusterControl, setB[0]);
1725  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1726  setC[1] = matchDistr(clusterControl, setC[0]);
1727  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1728  setD[1] = matchDistr(clusterControl, setD[0]);
1729  Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
1730  probADF = (setA[1]*setD[1])/tmp;
1731  probBCF = (setB[1]*setC[1])/tmp;
1732  if(probADF>probBCF)
1733  {
1734  mPoint->addNewPoint(newPointA);
1735  mPoint->addNewPoint(newPointD);
1736  mPoint->addNewPoint(newPointF);
1737  }
1738  else
1739  {
1740  mPoint->addNewPoint(newPointB);
1741  mPoint->addNewPoint(newPointC);
1742  mPoint->addNewPoint(newPointF);
1743  }
1744  newPointA->setFlag(int(100*probADF));
1745  newPointB->setFlag(int(100*probBCF));
1746  newPointC->setFlag(int(100*probBCF));
1747  newPointD->setFlag(int(100*probADF));
1748  nSolved++;
1749  }
1750 // 24 *********************************************************************
1751  else if(!strcmp(currentKind,"1p1n2n2p1n2n3n3p3n"))// case (3-3)BSP
1752  {
1753  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1754  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1755  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1756  //mPoint->addNewPoint(newPointA);
1757 
1758  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1759  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1760  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1761  //mPoint->addNewPoint(newPointB);
1762 
1763  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1764  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1765  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
1766  //mPoint->addNewPoint(newPointC);
1767 
1768  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1769  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1770  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1771  //mPoint->addNewPoint(newPointD);
1772 
1773  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1774  setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(6));
1775  newPointF->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
1776  newPointF->setNMatched(33);
1777  newPointF->setFlag(100);
1778  //mPoint->addNewPoint(newPointF);
1779 
1780 // traitement propre aux space points..(probabilite)
1781  Double_t setA[2], setB[2], setC[2], setD[2];
1782  Double_t probADF, probBCF;
1783 
1784  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1785  setA[1] = matchDistr(clusterControl, setA[0]);
1786  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1787  setB[1] = matchDistr(clusterControl, setB[0]);
1788  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1789  setC[1] = matchDistr(clusterControl, setC[0]);
1790  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1791  setD[1] = matchDistr(clusterControl, setD[0]);
1792  Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
1793  probADF = (setA[1]*setD[1])/tmp;
1794  probBCF = (setB[1]*setC[1])/tmp;
1795  if(probADF>probBCF)
1796  {
1797  mPoint->addNewPoint(newPointA);
1798  mPoint->addNewPoint(newPointD);
1799  mPoint->addNewPoint(newPointF);
1800  }
1801  else
1802  {
1803  mPoint->addNewPoint(newPointB);
1804  mPoint->addNewPoint(newPointC);
1805  mPoint->addNewPoint(newPointF);
1806  }
1807  newPointA->setFlag(int(100*probADF));
1808  newPointB->setFlag(int(100*probBCF));
1809  newPointC->setFlag(int(100*probBCF));
1810  newPointD->setFlag(int(100*probADF));
1811  nSolved++;
1812  }
1813 // 25 *********************************************************************
1814  else if(!strcmp(currentKind,"1p1n2n3n2p2n3n3p3n"))// case (3-3)C
1815  {
1816  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1817  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1818  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1819  newPointA->setFlag(100);
1820  mPoint->addNewPoint(newPointA);
1821 
1822  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1823  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
1824  newPointD->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
1825  newPointD->setFlag(100);
1826  mPoint->addNewPoint(newPointD);
1827 
1828  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1829  setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(3));
1830  newPointF->setEnergyLossCorrected(Adc[7], Adc[3],CalibArray);
1831  newPointF->setFlag(100);
1832  mPoint->addNewPoint(newPointF);
1833 
1834  nSolved++;
1835  }
1836 
1837 // 26 *********************************************************************
1838  else if(!strcmp(currentKind,"1p1n2p1n2n3p1n2n3n"))// case (3-3)CS
1839  {
1840  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1841  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1842  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1843  newPointA->setFlag(100);
1844  mPoint->addNewPoint(newPointA);
1845 
1846  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1847  setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(4));
1848  newPointD->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1849  newPointD->setFlag(100);
1850  mPoint->addNewPoint(newPointD);
1851 
1852  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1853  setMatcheds(dimensions, newPointF, currentPackage->getMatched(5), currentPackage->getMatched(8));
1854  newPointF->setEnergyLossCorrected(Adc[5], Adc[8],CalibArray);
1855  newPointF->setFlag(100);
1856  mPoint->addNewPoint(newPointF);
1857 
1858  nSolved++;
1859  }
1860 
1861 // 27 *********************************************************************
1862  else if(!strcmp(currentKind,"1p1n2n3n2p2n3n3p2n3n"))// case (3-3)D
1863  {
1864  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1865  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1866  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1867  newPointA->setFlag(100);
1868  //mPoint->addNewPoint(newPointA);
1869 
1870  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1871  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
1872  newPointD->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
1873  //mPoint->addNewPoint(newPointD);
1874 
1875  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1876  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(3));
1877  newPointE->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
1878  //mPoint->addNewPoint(newPointE);
1879 
1880  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1881  setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(2));
1882  newPointF->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
1883  //mPoint->addNewPoint(newPointF);
1884 
1885  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1886  setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(3));
1887  newPointG->setEnergyLossCorrected(Adc[7], Adc[3],CalibArray);
1888  //mPoint->addNewPoint(newPointG);
1889 
1890 // traitement propre aux space points..(probabilite)
1891  Double_t setD[2], setE[2], setF[2], setG[2];
1892  Double_t probADG, probAEF;
1893 
1894  setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
1895  setD[1] = matchDistr(clusterControl, setD[0]);
1896  setE[0] = (Adc[4] - Adc[3])/sqrt(2.0);
1897  setE[1] = matchDistr(clusterControl, setE[0]);
1898  setF[0] = (Adc[7] - Adc[2])/sqrt(2.0);
1899  setF[1] = matchDistr(clusterControl, setF[0]);
1900  setG[0] = (Adc[7] - Adc[3])/sqrt(2.0);
1901  setG[1] = matchDistr(clusterControl, setG[0]);
1902  Double_t tmp = 3e-33+(setD[1]*setG[1]+setE[1]*setF[1]);
1903  probADG = (setD[1]*setG[1])/tmp;
1904  probAEF = (setE[1]*setF[1])/tmp;
1905  if(probADG>probAEF)
1906  {
1907  mPoint->addNewPoint(newPointA);
1908  mPoint->addNewPoint(newPointD);
1909  mPoint->addNewPoint(newPointG);
1910  }
1911  else
1912  {
1913  mPoint->addNewPoint(newPointA);
1914  mPoint->addNewPoint(newPointE);
1915  mPoint->addNewPoint(newPointF);
1916  }
1917  newPointD->setFlag(int(100*probADG));
1918  newPointE->setFlag(int(100*probAEF));
1919  newPointF->setFlag(int(100*probAEF));
1920  newPointG->setFlag(int(100*probADG));
1921 
1922  nSolved++;
1923  }
1924 // 28 *********************************************************************
1925  else if(!strcmp(currentKind,"1p1n2p1n2n3n3p1n2n3n"))// case (3-3)DP
1926  {
1927  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1928  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1929  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1930  newPointA->setFlag(100);
1931  //mPoint->addNewPoint(newPointA);
1932 
1933  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1934  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1935  newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1936  //mPoint->addNewPoint(newPointC);
1937 
1938  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1939  setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1940  newPointD->setEnergyLossCorrected(Adc[2], Adc[5],CalibArray);
1941  //mPoint->addNewPoint(newPointD);
1942 
1943  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1944  setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(4));
1945  newPointF->setEnergyLossCorrected(Adc[6], Adc[4],CalibArray);
1946  //mPoint->addNewPoint(newPointF);
1947 
1948  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1949  setMatcheds(dimensions, newPointG, currentPackage->getMatched(6), currentPackage->getMatched(5));
1950  newPointG->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1951  //mPoint->addNewPoint(newPointG);
1952 
1953 // traitement propre aux space points..(probabilite)
1954  Double_t setC[2], setD[2], setF[2], setG[2];
1955  Double_t probACG, probADF;
1956 
1957  setC[0] = (Adc[2] - Adc[4])/sqrt(2.0);
1958  setC[1] = matchDistr(clusterControl, setC[0]);
1959  setD[0] = (Adc[2] - Adc[5])/sqrt(2.0);
1960  setD[1] = matchDistr(clusterControl, setD[0]);
1961  setF[0] = (Adc[6] - Adc[4])/sqrt(2.0);
1962  setF[1] = matchDistr(clusterControl, setF[0]);
1963  setG[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1964  setG[1] = matchDistr(clusterControl, setG[0]);
1965  Double_t tmp = 3e-33+(setC[1]*setG[1]+setD[1]*setF[1]);
1966  probACG = (setC[1]*setG[1])/tmp;
1967  probADF = (setD[1]*setF[1])/tmp;
1968  if(probACG>probADF)
1969  {
1970  mPoint->addNewPoint(newPointA);
1971  mPoint->addNewPoint(newPointC);
1972  mPoint->addNewPoint(newPointG);
1973  }
1974  else
1975  {
1976  mPoint->addNewPoint(newPointA);
1977  mPoint->addNewPoint(newPointD);
1978  mPoint->addNewPoint(newPointF);
1979  }
1980  newPointC->setFlag(int(100*probACG));
1981  newPointD->setFlag(int(100*probADF));
1982  newPointF->setFlag(int(100*probADF));
1983  newPointG->setFlag(int(100*probACG));
1984 
1985  nSolved++;
1986  }
1987 // 29 *********************************************************************
1988  else if(!strcmp(currentKind,"1p1n2n2p1n2n3p1n2n3n"))// case (3-3)DS
1989  {
1990  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1991  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1992  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1993  //mPoint->addNewPoint(newPointA);
1994 
1995  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1996  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1997  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1998  //mPoint->addNewPoint(newPointB);
1999 
2000  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2001  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
2002  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
2003  //mPoint->addNewPoint(newPointC);
2004 
2005  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2006  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
2007  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2008  //mPoint->addNewPoint(newPointD);
2009 
2010  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2011  setMatcheds(dimensions, newPointG, currentPackage->getMatched(6), currentPackage->getMatched(9));
2012  newPointG->setEnergyLossCorrected(Adc[6], Adc[9],CalibArray);
2013  newPointG->setFlag(100);
2014  //mPoint->addNewPoint(newPointG);
2015 
2016 // traitement propre aux space points..(probabilite)
2017  Double_t setA[2], setB[2], setC[2], setD[2];
2018  Double_t probADG, probBCG;
2019 
2020  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2021  setA[1] = matchDistr(clusterControl, setA[0]);
2022  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2023  setB[1] = matchDistr(clusterControl, setB[0]);
2024  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
2025  setC[1] = matchDistr(clusterControl, setC[0]);
2026  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
2027  setD[1] = matchDistr(clusterControl, setD[0]);
2028  Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
2029  probADG = (setA[1]*setD[1])/tmp;
2030  probBCG = (setB[1]*setC[1])/tmp;
2031  if(probADG>probBCG)
2032  {
2033  mPoint->addNewPoint(newPointA);
2034  mPoint->addNewPoint(newPointD);
2035  mPoint->addNewPoint(newPointG);
2036  }
2037  else
2038  {
2039  mPoint->addNewPoint(newPointB);
2040  mPoint->addNewPoint(newPointC);
2041  mPoint->addNewPoint(newPointG);
2042  }
2043  newPointA->setFlag(int(100*probADG));
2044  newPointB->setFlag(int(100*probBCG));
2045  newPointC->setFlag(int(100*probBCG));
2046  newPointD->setFlag(int(100*probADG));
2047 
2048  nSolved++;
2049  }
2050 // 30 *********************************************************************
2051  else if(!strcmp(currentKind,"1p1n2n3n2p1n2n3n3p3n"))//case (3-3)DSP
2052  {
2053  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2054  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2055  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2056  //mPoint->addNewPoint(newPointA);
2057 
2058  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2059  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2060  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2061  //mPoint->addNewPoint(newPointB);
2062 
2063  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2064  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
2065  newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
2066  //mPoint->addNewPoint(newPointD);
2067 
2068  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2069  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2070  newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2071  //mPoint->addNewPoint(newPointE);
2072 
2073  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2074  setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(3));
2075  newPointG->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2076  newPointG->setFlag(100);
2077  //mPoint->addNewPoint(newPointG);
2078 
2079 // traitement propre aux space points..(probabilite)
2080  Double_t setA[2], setB[2], setD[2], setE[2];
2081  Double_t probAEG, probBDG;
2082 
2083  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2084  setA[1] = matchDistr(clusterControl, setA[0]);
2085  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2086  setB[1] = matchDistr(clusterControl, setB[0]);
2087  setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2088  setD[1] = matchDistr(clusterControl, setD[0]);
2089  setE[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2090  setE[1] = matchDistr(clusterControl, setE[0]);
2091  Double_t tmp = 3e-33+(setA[1]*setE[1]+setB[1]*setD[1]);
2092  probAEG = (setA[1]*setE[1])/tmp;
2093  probBDG = (setB[1]*setD[1])/tmp;
2094  if(probAEG>probBDG)
2095  {
2096  mPoint->addNewPoint(newPointA);
2097  mPoint->addNewPoint(newPointE);
2098  mPoint->addNewPoint(newPointG);
2099  }
2100  else
2101  {
2102  mPoint->addNewPoint(newPointB);
2103  mPoint->addNewPoint(newPointD);
2104  mPoint->addNewPoint(newPointG);
2105  }
2106  newPointA->setFlag(int(100*probAEG));
2107  newPointB->setFlag(int(100*probBDG));
2108  newPointD->setFlag(int(100*probBDG));
2109  newPointE->setFlag(int(100*probAEG));
2110 
2111  nSolved++;
2112  }
2113 // 31 *********************************************************************
2114  else if(!strcmp(currentKind,"1p1n2p1n2n3n3p3n"))// case (3-3)E
2115  {
2116  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2117  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2118  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2119  newPointA->setFlag(100);
2120  mPoint->addNewPoint(newPointA);
2121 
2122  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2123  setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
2124  newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
2125  newPointC->setFlag(100);
2126  mPoint->addNewPoint(newPointC);
2127 
2128  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2129  setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(5));
2130  newPointE->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
2131  newPointE->setFlag(100);
2132  mPoint->addNewPoint(newPointE);
2133 
2134  nSolved++;
2135  }
2136 // 32 *********************************************************************
2137  else if(!strcmp(currentKind,"1p1n2n2p2n3p2n3n"))// case (3-3)EP
2138  {
2139  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2140  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2141  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2142  newPointA->setFlag(100);
2143  mPoint->addNewPoint(newPointA);
2144 
2145  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2146  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
2147  newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2148  newPointC->setFlag(100);
2149  mPoint->addNewPoint(newPointC);
2150 
2151  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2152  setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(7));
2153  newPointE->setEnergyLossCorrected(Adc[5], Adc[7],CalibArray);
2154  newPointE->setFlag(100);
2155  mPoint->addNewPoint(newPointE);
2156 
2157  nSolved++;
2158  }
2159 // 33 *********************************************************************
2160  else if(!strcmp(currentKind,"1p1n2n2p1n2n3n3p2n3n"))// case (3-3)F
2161  {
2162  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2163  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2164  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2165  //mPoint->addNewPoint(newPointA);
2166 
2167  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2168  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2169  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2170  //mPoint->addNewPoint(newPointB);
2171 
2172  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2173  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
2174  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
2175  //mPoint->addNewPoint(newPointC);
2176 
2177  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2178  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
2179  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2180  //mPoint->addNewPoint(newPointD);
2181 
2182  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2183  setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
2184  newPointE->setEnergyLossCorrected(Adc[3], Adc[6],CalibArray);
2185  //mPoint->addNewPoint(newPointE);
2186 
2187  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2188  setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(2));
2189  newPointF->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
2190  //mPoint->addNewPoint(newPointF);
2191 
2192  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2193  setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(6));
2194  newPointG->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
2195  //mPoint->addNewPoint(newPointG);
2196 
2197 // traitement propre aux space points..(probabilite)
2198  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2];
2199  Double_t probADG, probAEF, probBCG;
2200 
2201  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2202  setA[1] = matchDistr(clusterControl, setA[0]);
2203  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2204  setB[1] = matchDistr(clusterControl, setB[0]);
2205  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
2206  setC[1] = matchDistr(clusterControl, setC[0]);
2207  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
2208  setD[1] = matchDistr(clusterControl, setD[0]);
2209  setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
2210  setE[1] = matchDistr(clusterControl, setE[0]);
2211  setF[0] = (Adc[7] - Adc[2])/sqrt(2.0);
2212  setF[1] = matchDistr(clusterControl, setF[0]);
2213  setG[0] = (Adc[7] - Adc[6])/sqrt(2.0);
2214  setG[1] = matchDistr(clusterControl, setG[0]);
2215  Double_t tmp = 3e-33+(setA[1]*setD[1]*setG[1]+setA[1]*setE[1]*setF[1]+setB[1]*setC[1]*setG[1]);
2216  probADG = (setA[1]*setD[1]*setG[1])/tmp;
2217  probAEF = (setA[1]*setE[1]*setF[1])/tmp;
2218  probBCG = (setB[1]*setC[1]*setG[1])/tmp;
2219  if ((probADG > probAEF)&&(probADG > probBCG))
2220  {
2221 
2222  mPoint->addNewPoint(newPointA);
2223  mPoint->addNewPoint(newPointD);
2224  mPoint->addNewPoint(newPointG);
2225  }
2226  else if ((probAEF > probADG)&&(probAEF > probBCG))
2227  {
2228  mPoint->addNewPoint(newPointA);
2229  mPoint->addNewPoint(newPointE);
2230  mPoint->addNewPoint(newPointF);
2231  }
2232  else if ((probBCG > probADG)&&(probBCG > probAEF))
2233  {
2234  mPoint->addNewPoint(newPointB);
2235  mPoint->addNewPoint(newPointC);
2236  mPoint->addNewPoint(newPointG);
2237  }
2238  newPointA->setFlag(int(100*(probADG+probAEF)));
2239  newPointB->setFlag(int(100*probBCG));
2240  newPointC->setFlag(int(100*probBCG));
2241  newPointD->setFlag(int(100*probADG));
2242  newPointE->setFlag(int(100*probAEF));
2243  newPointF->setFlag(int(100*probAEF));
2244  newPointG->setFlag(int(100*(probADG+probBCG)));
2245 
2246  nSolved++;
2247  }
2248 // 34 *********************************************************************
2249  else if(!strcmp(currentKind,"1p1n2n3n2p1n2n3n3p2n3n"))// case (3-3)G
2250  {
2251  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2252  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2253  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2254  mPoint->addNewPoint(newPointA);
2255 
2256  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2257  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2258  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2259  mPoint->addNewPoint(newPointB);
2260 
2261  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2262  setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
2263  newPointC->setEnergyLossCorrected(Adc[0], Adc[3],CalibArray);
2264  mPoint->addNewPoint(newPointC);
2265 
2266  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2267  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
2268  newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
2269  mPoint->addNewPoint(newPointD);
2270 
2271  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2272  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2273  newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2274  mPoint->addNewPoint(newPointE);
2275 
2276  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2277  setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
2278  newPointF->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
2279  mPoint->addNewPoint(newPointF);
2280 
2281  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2282  setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(2));
2283  newPointG->setEnergyLossCorrected(Adc[8], Adc[2],CalibArray);
2284  mPoint->addNewPoint(newPointG);
2285 
2286  StSsdPoint *newPointH = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2287  setMatcheds(dimensions, newPointH, currentPackage->getMatched(8), currentPackage->getMatched(3));
2288  newPointH->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2289  mPoint->addNewPoint(newPointH);
2290 
2291 // traitement propre aux space points..(probabilite)
2292  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2];
2293  Double_t probAEH, probAFG, probBDH, probCDG;
2294 
2295  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2296  setA[1] = matchDistr(clusterControl, setA[0]);
2297  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2298  setB[1] = matchDistr(clusterControl, setB[0]);
2299  setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
2300  setC[1] = matchDistr(clusterControl, setC[0]);
2301  setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2302  setD[1] = matchDistr(clusterControl, setD[0]);
2303  setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2304  setE[1] = matchDistr(clusterControl, setE[0]);
2305  setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
2306  setF[1] = matchDistr(clusterControl, setF[0]);
2307  setG[0] = (Adc[8] - Adc[2])/sqrt(2.0);
2308  setG[1] = matchDistr(clusterControl, setG[0]);
2309  setH[0] = (Adc[8] - Adc[3])/sqrt(2.0);
2310  setH[1] = matchDistr(clusterControl, setH[0]);
2311  Double_t tmp = 3e-33+(setA[1]*setE[1]*setH[1]+setA[1]*setF[1]*setG[1]+setB[1]*setD[1]*setH[1]+setC[1]*setD[1]*setG[1]);
2312  probAEH = (setA[1]*setE[1]*setH[1])/tmp;
2313  probAFG = (setA[1]*setF[1]*setG[1])/tmp;
2314  probBDH = (setB[1]*setD[1]*setH[1])/tmp;
2315  probCDG = (setC[1]*setD[1]*setG[1])/tmp;
2316  newPointA->setFlag(int(100*(probAEH+probAFG)));
2317  newPointB->setFlag(int(100*probBDH));
2318  newPointC->setFlag(int(100*probCDG));
2319  newPointD->setFlag(int(100*(probBDH+probCDG)));
2320  newPointE->setFlag(int(100*probAEH));
2321  newPointF->setFlag(int(100*probAFG));
2322  newPointG->setFlag(int(100*(probAFG+probCDG)));
2323  newPointH->setFlag(int(100*(probAEH+probBDH)));
2324 
2325  nSolved++;
2326  }
2327 // 35 *********************************************************************
2328  else if(!strcmp(currentKind,"1p1n2n2p1n2n3n3p1n2n3n"))// case (3-3)GS
2329  {
2330  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2331  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2332  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2333  mPoint->addNewPoint(newPointA);
2334 
2335  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2336  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2337  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2338  mPoint->addNewPoint(newPointB);
2339 
2340  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2341  setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
2342  newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
2343  mPoint->addNewPoint(newPointC);
2344 
2345  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2346  setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
2347  newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2348  mPoint->addNewPoint(newPointD);
2349 
2350  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2351  setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
2352  newPointE->setEnergyLossCorrected(Adc[3], Adc[6],CalibArray);
2353  mPoint->addNewPoint(newPointE);
2354 
2355  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2356  setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(1));
2357  newPointF->setEnergyLossCorrected(Adc[7], Adc[1],CalibArray);
2358  mPoint->addNewPoint(newPointF);
2359 
2360  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2361  setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(2));
2362  newPointG->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
2363  mPoint->addNewPoint(newPointG);
2364 
2365  StSsdPoint *newPointH = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2366  setMatcheds(dimensions, newPointH, currentPackage->getMatched(7), currentPackage->getMatched(6));
2367  newPointH->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
2368  mPoint->addNewPoint(newPointH);
2369 
2370 // traitement propre aux space points..(probabilite)
2371  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2];
2372  Double_t probADH, probAEG, probBCH, probBEF;
2373 
2374  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2375  setA[1] = matchDistr(clusterControl, setA[0]);
2376  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2377  setB[1] = matchDistr(clusterControl, setB[0]);
2378  setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
2379  setC[1] = matchDistr(clusterControl, setC[0]);
2380  setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
2381  setD[1] = matchDistr(clusterControl, setD[0]);
2382  setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
2383  setE[1] = matchDistr(clusterControl, setE[0]);
2384  setF[0] = (Adc[7] - Adc[1])/sqrt(2.0);
2385  setF[1] = matchDistr(clusterControl, setF[0]);
2386  setG[0] = (Adc[7] - Adc[2])/sqrt(2.0);
2387  setG[1] = matchDistr(clusterControl, setG[0]);
2388  setH[0] = (Adc[7] - Adc[6])/sqrt(2.0);
2389  setH[1] = matchDistr(clusterControl, setH[0]);
2390  Double_t tmp = 3e-33+(setA[1]*setD[1]*setH[1]+setA[1]*setE[1]*setG[1]+setB[1]*setC[1]*setH[1]+setB[1]*setE[1]*setF[1]);
2391  probADH = (setA[1]*setD[1]*setH[1])/tmp;
2392  probAEG = (setA[1]*setE[1]*setG[1])/tmp;
2393  probBCH = (setB[1]*setC[1]*setH[1])/tmp;
2394  probBEF = (setB[1]*setE[1]*setF[1])/tmp;
2395  newPointA->setFlag(int(100*(probADH+probAEG)));
2396  newPointB->setFlag(int(100*(probBCH+probBEF)));
2397  newPointC->setFlag(int(100*probBCH));
2398  newPointD->setFlag(int(100*probADH));
2399  newPointE->setFlag(int(100*(probAEG+probBEF)));
2400  newPointF->setFlag(int(100*probBEF));
2401  newPointG->setFlag(int(100*probAEG));
2402  newPointH->setFlag(int(100*(probADH+probBCH)));
2403 
2404  nSolved++;
2405  }
2406 // 36 *********************************************************************
2407  else if(!strcmp(currentKind,"1p1n2n3n2p1n2n3n3p1n2n3n"))// case (3-3)H
2408  {
2409  StSsdPoint *newPointA = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2410  setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2411  newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2412  mPoint->addNewPoint(newPointA);
2413 
2414  StSsdPoint *newPointB = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2415  setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2416  newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2417  mPoint->addNewPoint(newPointB);
2418 
2419  StSsdPoint *newPointC = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2420  setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
2421  newPointC->setEnergyLossCorrected(Adc[0], Adc[3],CalibArray);
2422  mPoint->addNewPoint(newPointC);
2423 
2424  StSsdPoint *newPointD = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2425  setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
2426  newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
2427  mPoint->addNewPoint(newPointD);
2428 
2429  StSsdPoint *newPointE = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2430  setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2431  newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2432  mPoint->addNewPoint(newPointE);
2433 
2434  StSsdPoint *newPointF = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2435  setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
2436  newPointF->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
2437  mPoint->addNewPoint(newPointF);
2438 
2439  StSsdPoint *newPointG = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2440  setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(1));
2441  newPointG->setEnergyLossCorrected(Adc[8], Adc[1],CalibArray);
2442  mPoint->addNewPoint(newPointG);
2443 
2444  StSsdPoint *newPointH = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2445  setMatcheds(dimensions, newPointH, currentPackage->getMatched(8), currentPackage->getMatched(2));
2446  newPointH->setEnergyLossCorrected(Adc[8], Adc[2],CalibArray);
2447  mPoint->addNewPoint(newPointH);
2448 
2449  StSsdPoint *newPointI = new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2450  setMatcheds(dimensions, newPointI, currentPackage->getMatched(8), currentPackage->getMatched(3));
2451  newPointI->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2452  mPoint->addNewPoint(newPointI);
2453 
2454 // traitement propre aux space points..(probabilite)
2455  Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2], setI[2];
2456  Double_t probAEI, probCEG, probAFH, probBDI, probCDH, probBFG;
2457 
2458  setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2459  setA[1] = matchDistr(clusterControl, setA[0]);
2460  setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2461  setB[1] = matchDistr(clusterControl, setB[0]);
2462  setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
2463  setC[1] = matchDistr(clusterControl, setC[0]);
2464  setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2465  setD[1] = matchDistr(clusterControl, setD[0]);
2466  setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2467  setE[1] = matchDistr(clusterControl, setE[0]);
2468  setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
2469  setF[1] = matchDistr(clusterControl, setF[0]);
2470  setG[0] = (Adc[8] - Adc[1])/sqrt(2.0);
2471  setG[1] = matchDistr(clusterControl, setG[0]);
2472  setH[0] = (Adc[8] - Adc[2])/sqrt(2.0);
2473  setH[1] = matchDistr(clusterControl, setH[0]);
2474  setI[0] = (Adc[8] - Adc[3])/sqrt(2.0);
2475  setI[1] = matchDistr(clusterControl, setI[0]);
2476  Double_t tmp = (3e-33+setA[1]*setE[1]*setI[1]+setC[1]*setE[1]*setG[1]+setA[1]*setF[1]*setH[1]+setB[1]*setD[1]*setI[1]+setC[1]*setD[1]*setH[1]+setB[1]*setF[1]*setG[1]);
2477  probAEI = (setA[1]*setE[1]*setI[1])/(tmp);
2478  probCEG = (setC[1]*setE[1]*setG[1])/(tmp);
2479  probAFH = (setA[1]*setF[1]*setH[1])/(tmp);
2480  probBDI = (setB[1]*setD[1]*setI[1])/(tmp);
2481  probCDH = (setC[1]*setD[1]*setH[1])/(tmp);
2482  probBFG = (setB[1]*setF[1]*setG[1])/(tmp);
2483  newPointA->setFlag(int(100*(probAEI+probAFH)));
2484  newPointB->setFlag(int(100*(probBDI+probBFG)));
2485  newPointC->setFlag(int(100*(probCEG+probCDH)));
2486  newPointD->setFlag(int(100*(probBDI+probCDH)));
2487  newPointE->setFlag(int(100*(probAEI+probCEG)));
2488  newPointF->setFlag(int(100*(probAFH+probBFG)));
2489  newPointG->setFlag(int(100*(probCEG+probBFG)));
2490  newPointH->setFlag(int(100*(probAFH+probCDH)));
2491  newPointI->setFlag(int(100*(probAEI+probBDI)));
2492 
2493  nSolved++;
2494  }
2495  else cout<<" Warning unsolved case ("<<currentKind<<")\n";// other cases
2496  delete [] Adc;
2497  currentPackage=mPackage->next(currentPackage);
2498  }
2499  return nSolved;
2500 }
2501 //________________________________________________________________________________
2502 Int_t StSsdWafer::convertDigitToAnalog(Double_t pairCreationEnergy)
2503 {
2504  StSsdPoint *currentPoint = mPoint->first();
2505  while(currentPoint)
2506  {
2507  currentPoint->setDe(currentPoint->getDe(0)*pairCreationEnergy,0);
2508  currentPoint->setDe(currentPoint->getDe(1)*pairCreationEnergy,1);
2509  currentPoint = mPoint->next(currentPoint);
2510  }
2511  return 1;
2512 }
2513 //________________________________________________________________________________
2514 Int_t StSsdWafer::convertUFrameToLocal(ssdDimensions_st *dimensions)
2515 {
2516  StSsdPoint *currentPoint = mPoint->first();
2517  while(currentPoint)
2518  {
2519  // printf("posU(0)=%f posU(1)=%f\n",currentPoint->getPositionU(0),currentPoint->getPositionU(1));
2520  currentPoint->setXl(currentPoint->getPositionU(0)/2.+currentPoint->getPositionU(1)/2.-dimensions[0].waferHalfActLength+dimensions[0].waferHalfActWidth*tan(dimensions[0].stereoAngle),0);
2521  currentPoint->setXl((currentPoint->getPositionU(1)-currentPoint->getPositionU(0))/(2*tan(dimensions[0].stereoAngle)),1);
2522  currentPoint = mPoint->next(currentPoint);
2523  }
2524  return 1;
2525 }
2526 //________________________________________________________________________________
2527 Int_t StSsdWafer::convertLocalToGlobal() {
2528  StSsdPoint *currentPoint = mPoint->first();
2529  Double_t xg[3];
2530  while(currentPoint) {
2531  // sign (-) of B[0] : temporarily fixed - order of strip readout has to be reversed
2532  Double_t xl[3] = {-currentPoint->getXl(0), currentPoint->getXl(1), currentPoint->getXl(2)};
2533  LocalToMaster(xl,xg);
2534  currentPoint->setXg(xg[0],0);
2535  currentPoint->setXg(xg[1],1);
2536  currentPoint->setXg(xg[2],2);
2537  currentPoint = mPoint->next(currentPoint);
2538  }
2539  return 1;
2540 }
2541 //________________________________________________________________________________
2542 Int_t StSsdWafer::convertGlobalToLocal() {
2543  Int_t localSize = (this->mPoint)->getSize();
2544  if (!localSize) return 0;
2545  StSsdPoint *temp = mPoint->first();
2546  for (Int_t i = 0; i < localSize; i++) {
2547  Double_t xg[3] = {temp->getXg(0), temp->getXg(1), temp->getXg(2)};
2548  Double_t xl[3];
2549  MasterToLocal(xg,xl);
2550  temp->setXl(-xl[0], 0);
2551  temp->setXl( xl[1], 1);
2552  temp->setXl( xl[2], 2);
2553  temp = mPoint->next(temp);
2554  }
2555  return 1;
2556 }
2557 //________________________________________________________________________________
2558 Int_t StSsdWafer::convertLocalToUFrame(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge, Float_t Theta)
2559 {
2560  Int_t localSize = (mPoint)->getSize();
2561  if (!localSize) return 0;
2562 
2563  StSsdPoint *temp = (mPoint)->first();
2564  for (Int_t i = 0; i < localSize; i++)
2565 
2566  {
2567  temp->setUpos((temp->getXl(0)+(ActiveLargeEdge/2.))-(temp->getXl(1)+(ActiveSmallEdge/2.))*tan(Theta), 0);
2568  temp->setUpos((temp->getXl(0)+(ActiveLargeEdge/2.))+(temp->getXl(1)-(ActiveSmallEdge/2.))*tan(Theta), 1);
2569  temp = mPoint->next(temp);
2570  }
2571  //return 1;
2572  return localSize;
2573 }
2574 //________________________________________________________________________________
2575 StSsdPointList* StSsdWafer::getDeadHits(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge,Float_t Test)
2576 {
2577  StSsdPointList *listDeadBorder = getNonActivePointBorder(ActiveLargeEdge,ActiveSmallEdge);
2578  StSsdPointList *listDeadTriangle = getNonActivePointTriangle(Test);
2579  StSsdPointList *listDeadTotal = new StSsdPointList();
2580  listDeadTotal = listDeadTotal->addPointList(listDeadBorder);
2581  listDeadTotal = listDeadTotal->addPointList(listDeadTriangle);
2582  listDeadTotal = listDeadTotal->removeMultipleCount();
2583  (mPoint)->substractPointList(listDeadTotal);
2584  delete listDeadBorder;
2585  delete listDeadTriangle;
2586  return listDeadTotal;
2587 }
2588 //________________________________________________________________________________
2589 void StSsdWafer::convertToStrip(Float_t Pitch,
2590  Int_t nStripPerSide,
2591  Double_t pairCreationEnergy,
2592  Int_t nstripInACluster,
2593  Double_t parDiffP,
2594  Double_t parDiffN,
2595  Double_t parIndRightP,
2596  Double_t parIndRightN,
2597  Double_t parIndLeftP,
2598  Double_t parIndLeftN,
2599  Float_t mShift_hole,
2600  Float_t mShift_elec)
2601 {
2602  convertHitToStrip(Pitch,
2603  nStripPerSide,
2604  nstripInACluster,
2605  parDiffP,
2606  parDiffN,
2607  parIndRightP,
2608  parIndRightN,
2609  parIndLeftP,
2610  parIndLeftN,
2611  mShift_hole,
2612  mShift_elec);
2613  convertAnalogToDigit(pairCreationEnergy);
2614  mStripP->sortStrip();
2615  mStripN->sortStrip();
2616 }
2617 //________________________________________________________________________________
2618 Int_t StSsdWafer::printborder()
2619 {
2620  if (mId==7101){
2621  printf("Wafer = %d \n",mId);
2622  Double_t actives[4][3],templs[4][3];
2623  Double_t activee[4][3],temple[4][3];
2624 
2625  actives[0][0]=-3.65,actives[1][0]= 3.65,actives[2][0]= 3.65,actives[3][0]=-3.65;
2626  actives[0][1]= 2.00,actives[1][1]= 2.00,actives[2][1]=-2.00,actives[3][1]=-2.00;
2627  actives[0][2]= 0.00,actives[1][2]= 0.00,actives[2][2]= 0.00,actives[3][2]= 0.00;
2628 
2629  activee[0][0]= 3.65,activee[1][0]= 3.65,activee[2][0]=-3.65,activee[3][0]=-3.65;
2630  activee[0][1]= 2.00,activee[1][1]=-2.00,activee[2][1]=-2.00,activee[3][1]= 2.00;
2631  activee[0][2]= 0.00,activee[1][2]= 0.00,activee[2][2]= 0.00,activee[3][2]= 0.00;
2632  for (Int_t j = 0; j < 4; j++) {
2633  LocalToMaster(actives[j], templs[j]);
2634  LocalToMaster(activee[j], temple[j]);
2635  }
2636  const Char_t *xyz[3] = {"x","y","z"};
2637  for (Int_t i = 0; i < 3; i++) {
2638  printf("%ssSsdLadder%d set {",xyz[i],mId-7100);
2639  for (Int_t j = 0; j < 4; j++) printf("%.2f ",templs[j][i]);
2640  printf("}\n");
2641  printf("%seSsdLadder%d set {",xyz[i],mId-7100);
2642  for (Int_t j = 0; j < 4; j++) printf("%.2f ",temple[j][i]);
2643  printf("}\n");
2644  }
2645  }
2646  return 1;
2647 }
2648 //________________________________________________________________________________
2649 StSsdWafer::StSsdWafer(const StSsdWafer & originalWafer)
2650 {
2651  memcpy (first, originalWafer.first, last-first);
2652  mStripP = new StSsdStripList();
2653  mStripN = new StSsdStripList();
2654  mNoiseP = new StSpaListNoise();
2655  mNoiseN = new StSpaListNoise();
2656  mClusterP = new StSsdClusterList();
2657  mClusterN = new StSsdClusterList();
2658  mPackage = new StSsdPackageList();
2659  mPoint = new StSsdPointList();
2660 }
2661 
2662 StSsdWafer& StSsdWafer::operator=(const StSsdWafer originalWafer) {
2663  memset(first, 0, last-first);
2664  mId = originalWafer.mId;
2665  SetName(originalWafer.GetName());
2666  SetRotation(originalWafer.GetRotationMatrix());
2667  SetTranslation(originalWafer.GetTranslation());
2668  return *this;
2669 }
2670 //________________________________________________________________________________
2674 Int_t StSsdWafer::geoMatched(ssdDimensions_st *dimensions, StSsdCluster *ptr1, StSsdCluster *ptr2)
2675 {
2676  Int_t geomatched = 0;
2677  Int_t numStrip = int((2*dimensions[0].waferHalfActWidth*tan(dimensions[0].stereoAngle)/dimensions[0].stripPitch)+1);
2678  if ( (!ptr1) || (!ptr2) )
2679  geomatched = 0;
2680  else if((ptr2->getStripMean() > ( ptr1->getStripMean() - numStrip))
2681  && (ptr2->getStripMean() < (ptr1->getStripMean() + numStrip)))
2682  geomatched = 1;
2683  return geomatched;
2684 }
2685 //________________________________________________________________________________
2689 Int_t StSsdWafer::setMatcheds(ssdDimensions_st *dimensions, StSsdPoint *Point, StSsdCluster *pMatched, StSsdCluster *nMatched)
2690 {// strip(1) -> Upos(0)...
2691  Point->setPositionU((pMatched->getStripMean()-1)*dimensions[0].stripPitch,0);
2692  Point->setPositionU((nMatched->getStripMean()-1)*dimensions[0].stripPitch,1);
2693  Point->setIdClusterP(pMatched->getNCluster());
2694  Point->setIdClusterN(nMatched->getNCluster());
2695 
2696  // for evaluation only !!!
2697  Int_t pHitIndex = 0;
2698  Int_t nHitIndex = 0;
2699  Int_t sptHitIndex = 0;
2700  for (pHitIndex = 0; pHitIndex < SSD_MAXIDMCHIT; pHitIndex++)
2701  {
2702  for (nHitIndex = 0; nHitIndex < SSD_MAXIDMCHIT; nHitIndex++)
2703  {
2704  if ((pMatched->getIdMcHit(pHitIndex))
2705  &&(nMatched->getIdMcHit(nHitIndex))
2706  &&(pMatched->getIdMcHit(pHitIndex) == nMatched->getIdMcHit(nHitIndex))
2707  &&(sptHitIndex < SSD_MAXIDMCHIT))
2708  Point->setNMchit(pMatched->getIdMcHit(pHitIndex),sptHitIndex++);
2709  }
2710  }
2711  return 1;
2712 }
2713 //________________________________________________________________________________
2714 Double_t StSsdWafer::matchDistr(StSsdClusterControl *clusterControl, Double_t x)
2715 {
2716  Double_t mean = clusterControl->getMatchMean();
2717  Double_t sigm = clusterControl->getMatchSigma();
2718  return TMath::Gaus(x, mean, sigm, 1);
2719 }
2720 //________________________________________________________________________________
2721 void StSsdWafer::addHit(Int_t rNId , Int_t rMcHit, Int_t rMcTrack, Float_t *rXg , Float_t rDe, Float_t *p)
2722 {
2723  Float_t *alpha = new float[2];
2724  alpha[0] = 0.;
2725  alpha[1] = 0.;
2726  StSsdPoint *tmpPoint = new StSsdPoint(rNId, rMcHit, rMcTrack, rXg, rDe, findAngle(p,alpha));
2727  (mPoint)->addNewPoint(tmpPoint);
2728  delete [] alpha;
2729 }
2730 //________________________________________________________________________________
2731 StSsdPointList* StSsdWafer::getNonActivePointBorder(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge)
2732 {
2733  Int_t localSize = (mPoint)->getSize();
2734 
2735  StSsdPointList *deadPoints = new StSsdPointList();
2736  if (!localSize) return deadPoints;
2737 
2738  StSsdPoint *temp = (mPoint)->first();
2739  for (Int_t i = 0; i < localSize; i++)
2740  {
2741  if((temp->getXl(0) >(ActiveLargeEdge/2.)) || (temp->getXl(0) < (-ActiveLargeEdge/2.)) ||
2742  (temp->getXl(1) >(ActiveSmallEdge/2.)) || (temp->getXl(1) < (-ActiveSmallEdge/2.)))
2743  {
2744  // tempo : I can remove the hit now, just to keep information.
2745  StSsdPoint *badPoint = temp->giveCopy();
2746  deadPoints->addNewPoint(badPoint);
2747  }
2748  temp = (mPoint)->next(temp);
2749  }
2750  return deadPoints;
2751 }
2752 //________________________________________________________________________________
2753  StSsdPointList* StSsdWafer::getNonActivePointTriangle(Float_t Test)
2754  //typically, test=pitch
2755 {
2756  Int_t localSize = (mPoint)->getSize();
2757  StSsdPointList *deadPoints = new StSsdPointList();
2758 
2759  if (!localSize) return deadPoints;
2760 
2761  StSsdPoint *temp = (mPoint)->first();
2762  for (Int_t i = 0; i < localSize; i++)
2763  {
2764  if (temp->getPositionU(0) < -1.*Test && temp->getPositionU(1) < -1.*Test)
2765  {
2766  // tempo : I can remove the hit now, just to keep information.
2767  StSsdPoint *badPoint = temp->giveCopy();
2768  deadPoints->addNewPoint(badPoint);
2769  }
2770  temp = (mPoint)->next(temp);
2771  }
2772  return deadPoints;
2773 }
2774 
2775 //________________________________________________________________________________
2776 Double_t StSsdWafer::myErf(Double_t x)
2777 {
2778  const Double_t a1 = -1.26551223, a2 = 1.00002368,
2779  a3 = 0.37409196, a4 = 0.09678418,
2780  a5 = -0.18628806, a6 = 0.27886807,
2781  a7 = -1.13520398, a8 = 1.48851587,
2782  a9 = -0.82215223, a10 = 0.17087277;
2783 
2784  Double_t v = 1.;
2785  Double_t z = ((x) < 0. ? -(x) : (x));
2786 
2787  if (z <= 0) return (1.-v); // erfc(0)=1
2788  Double_t t = 1./(1.+0.5*z);
2789  v = t*exp((-z*z) +a1+t*(a2+t*(a3+t*(a4+t*(a5+t*(a6+t*(a7+t*(a8+t*(a9+t*a10)))))))));
2790 
2791  if (x < 0) v = 2.-v; // erfc(-x)=2-erfc(x)
2792  return (1.-v);
2793 }
2794 //________________________________________________________________________________
2795 void StSsdWafer::convertHitToStrip(Float_t Pitch,
2796  Int_t nStripPerSide,
2797  Int_t nstripInACluster,
2798  Double_t parDiffP,
2799  Double_t parDiffN,
2800  Double_t parIndRightP,
2801  Double_t parIndRightN,
2802  Double_t parIndLeftP,
2803  Double_t parIndLeftN,
2804  Float_t mShift_hole,
2805  Float_t mShift_elec)
2806 {
2807  const Double_t parDiff[2]={parDiffP/Pitch,parDiffN/Pitch};
2808  const Double_t parIndRight[2]={parIndRightP,parIndRightN};
2809  const Double_t parIndLeft[2]={parIndLeftP,parIndLeftN};
2810 
2811  Int_t *tabInd = new Int_t[nstripInACluster];
2812  Float_t *tabDe = new Float_t[nstripInACluster];
2813 
2814  StSsdPoint *ptr = (mPoint)->first();
2815  Int_t localSize = (mPoint)->getSize();
2816  for (Int_t iPoint = 0; iPoint < localSize; iPoint++)
2817  {
2818  for (Int_t iSide = 0; iSide < 2; iSide++)
2819  {
2820  for (Int_t v = 0 ; v < nstripInACluster; v++)
2821  {
2822  tabInd[v] = 0 ;
2823  tabDe[v] = 0.;
2824  }
2825  if (Debug()) LOG_DEBUG<<Form("Before Lorentz Shift")<<endm;
2826  if (Debug()) LOG_DEBUG<<Form("position of the hit : strip P=%f stripN=%f Pitch=%f",ptr->getPositionU(0),ptr->getPositionU(1),Pitch)<<endm;
2827  UndoLorentzShift(ptr,iSide,mShift_hole,mShift_elec,Pitch);
2828  if (Debug()) LOG_DEBUG<<Form("After Lorentz Shift\n");
2829  if (Debug()) LOG_DEBUG<<Form("position of the hit : strip P=%f stripN=%f Pitch=%f",ptr->getPositionU(0),ptr->getPositionU(1),Pitch)<<endm;
2830  tabInd[0] = (int)(ptr->getPositionU(iSide)/Pitch + 1.);//getPositionU(iSide)->getPositionU(iSide)+shift
2831  tabInd[1] = tabInd[0]+1;
2832  tabInd[2] = tabInd[0]-1;
2833  tabInd[3] = tabInd[0]+2;
2834  if (Debug()) LOG_DEBUG<<Form("Mean strip=%d strip1=%d strip2=%d strip3=%d",tabInd[0],tabInd[1],tabInd[2],tabInd[3])<<endm;
2835  Double_t rest = (double)(ptr->getPositionU(iSide)/Pitch) - (double)(tabInd[0]-1);
2836  Double_t Result=0.5*(1.+myErf((rest-0.5)/sqrt(2.)/parDiff[iSide]) );
2837  Float_t TmpDe0 = 0.;
2838  Float_t TmpDe1 = 0.;
2839  tabDe[0] = (1.-Result)*ptr->getDe();
2840  tabDe[1] = Result*ptr->getDe();
2841  tabDe[2] = tabDe[0]*parIndLeft[iSide];
2842  tabDe[3] = tabDe[1]*parIndRight[iSide];
2843  TmpDe0 = tabDe[1]*parIndLeft[iSide];
2844  TmpDe1 = tabDe[0]*parIndRight[iSide];
2845  tabDe[0] += TmpDe0;
2846  tabDe[1] += TmpDe1;
2847  for (Int_t st = 0; st < nstripInACluster; st++)
2848  {
2849  if ( tabInd[st] > 0 && tabInd[st] < nStripPerSide+1 )
2850  {
2851  if (Debug())printf("st =%d id =%d tabDe(%d)=%f charge=%f NId=%d McHit=%d MvTrack=%d\n",st,tabInd[st],st,tabDe[st],ptr->getDe(),ptr->getNId(),ptr->getMcHit(),ptr->getMcTrack());
2852  StSsdStrip *newStrip = new StSsdStrip(tabInd[st], ptr->getNId(), ptr->getMcHit(), ptr->getMcTrack(), tabDe[st]);
2853  switch (iSide)
2854  {
2855  case 0:
2856  mStripP->updateStrip(newStrip);
2857  break;
2858  case 1:
2859  mStripN->updateStrip(newStrip);
2860  break;
2861  }
2862  }
2863  }
2864  }
2865  ptr = (mPoint)->next(ptr);
2866  }
2867  delete [] tabInd;
2868  delete [] tabDe;
2869 }
2870 //________________________________________________________________________________
2871 void StSsdWafer::convertAnalogToDigit(Double_t pairCreationEnergy)
2872 {
2873  const Double_t ConversionFactor = 1./pairCreationEnergy;//GeV
2874 
2875  Int_t localSize = mStripP->getSize();
2876  StSsdStrip *curr = mStripP->first();
2877  Int_t i = 0;
2878  for (i = 0; i < localSize; i++)
2879  {
2880  curr->setDigitSig((int)(curr->getAnalogSig()*ConversionFactor));
2881  curr = mStripP->next(curr);
2882  }
2883  localSize = mStripN->getSize();
2884  curr = mStripN->first();
2885  for (i = 0; i < localSize; i++)
2886  {
2887  curr->setDigitSig((int)(curr->getAnalogSig()*ConversionFactor));
2888  curr = mStripN->next(curr);
2889  }
2890 }
2891 //________________________________________________________________________________
2892 float* StSsdWafer::findAngle(Float_t *p, Float_t *alpha)
2893 {
2894  Int_t i = 0;
2895  Float_t pT[3],pN[3],pD[3];
2896 
2897  Float_t spT = 0.;
2898  Float_t spN = 0.;
2899  Float_t spD = 0.;
2900 
2901  Float_t npN = 0.;
2902  Float_t npD = 0.;
2903 
2904  for (i = 0; i < 3; i++)
2905  {
2906  spN += n(i)*p[i] ;
2907  spT += t(i)*p[i] ;
2908  spD += d(i)*p[i] ;
2909  }
2910  for (i = 0; i < 3; i++)
2911  {
2912  pN[i] = n(i)*spN ;
2913  pT[i] = t(i)*spT ;
2914  pD[i] = d(i)*spD ;
2915  }
2916 
2917  npD = sqrt(pD[0]*pD[0]+pD[1]*pD[1]+pD[2]*pD[2]);
2918  npN = sqrt(pN[0]*pN[0]+pN[1]*pN[1]+pN[2]*pN[2]);
2919 
2920 // Float_t np = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2921  Float_t npDN = sqrt((pN[0]+pD[0])*(pN[0]+pD[0])+(pN[1]+pD[1])*(pN[1]+pD[1])+(pN[2]+pD[2])*(pN[2]+pD[2]));
2922  Float_t npTD = sqrt((pT[0]+pD[0])*(pT[0]+pD[0])+(pT[1]+pD[1])*(pT[1]+pD[1])+(pT[2]+pD[2])*(pT[2]+pD[2]));
2923 
2924  alpha[0] = acos(npN/npDN);
2925  Float_t sSign = 0.;
2926  sSign = pD[0]*pN[0]+pD[1]*pN[1]+pD[2]*pN[2]+npN*npN;
2927  if (sSign<0.) alpha[0] = -1.*alpha[0];
2928 
2929  alpha[1] = acos(npD/npTD);
2930  sSign = pD[0]*pT[0]+pD[1]*pT[1]+pD[2]*pT[2]+npD*npD;
2931  if (sSign<0.) alpha[1] = -1.*alpha[1];
2932 
2933  return alpha;
2934 }
2935 //________________________________________________________________________________
2936 void StSsdWafer::addNoiseToStripSignal(StSpaNoise *ptr, Int_t iSide)
2937 {
2938  if (iSide)
2939  { mNoiseN->addNewNoise(ptr); }
2940  else
2941  { mNoiseP->addNewNoise(ptr); }
2942 }
2943 //________________________________________________________________________________
2944 void StSsdWafer::setIsActive(Int_t rIsActive, Int_t iSide, Int_t rNStrip)
2945 {
2946  if (iSide)
2947  { mNoiseN->setIsActive(rIsActive, rNStrip); }
2948  else
2949  { mNoiseP->setIsActive(rIsActive, rNStrip); }
2950 }
2951 //________________________________________________________________________________
2952 void StSsdWafer::sortNoise()
2953 {
2954  mNoiseP->sortStrip();
2955  mNoiseN->sortStrip();
2956 }
2957 //________________________________________________________________________________
2958 void StSsdWafer::addNoiseToStripSignal(long nElectronInAMip,long adcDynamic)
2959 {
2960  mNoiseP->addSignal(mStripP, nElectronInAMip, adcDynamic);
2961  mNoiseN->addSignal(mStripN, nElectronInAMip, adcDynamic);
2962 }
2963 //________________________________________________________________________________
2964 void StSsdWafer::pedestalSubstraction()
2965 {
2966  mNoiseP->substractPedestal();
2967  mNoiseN->substractPedestal();
2968 }
2969 //________________________________________________________________________________
2970 void StSsdWafer::zeroSubstraction()
2971 {
2972  mNoiseP->zeroSubstraction();
2973  mNoiseN->zeroSubstraction();
2974 }
2975 //________________________________________________________________________________
2976 void StSsdWafer::convertAnalogToDigit(Long_t nElectronInAMip,Long_t adcDynamic,
2977  Long_t nbitEncoding, Float_t daqCutValue)
2978 {
2979  mNoiseP->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2980  nbitEncoding,daqCutValue);
2981  mNoiseN->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2982  nbitEncoding,daqCutValue);
2983 }
2984 //________________________________________________________________________________
2985 void StSsdWafer::updateStripList()
2986 {
2987  mStripP->updateStripList(mNoiseP);
2988  mStripN->updateStripList(mNoiseN);
2989 }
2990 //________________________________________________________________________________
2991 void StSsdWafer::UndoLorentzShift(StSsdPoint *ptr,Int_t iSide,Float_t mShift_hole,Float_t mShift_elec,Float_t pitch)
2992 {
2993  Float_t tempPosition = ptr->getPositionU(iSide);
2994  if(iSide==0){
2995  ptr->setPositionU(tempPosition+mShift_hole,iSide);
2996  }
2997  else
2998  if(iSide==1){
2999  ptr->setPositionU(tempPosition+mShift_elec,iSide);
3000  }
3001 }
3002 
void addCluster(StSsdCluster *ptr, Int_t iSide)
Attaches the ptr cluster on the iSide of the wafer.
Definition: StSsdWafer.cc:212
void sortCluster()
Definition: StSsdWafer.cc:252
void sortStrip()
Definition: StSsdWafer.cc:243
void sortPoint()
Definition: StSsdWafer.cc:261
void doLorentzShift(ssdDimensions_st *dimensions, Float_t mShift_hole, Float_t mShift_elec)
Definition: StSsdWafer.cc:446
void addPoint(StSsdPoint *ptr)
Attaches the ptr point on that wafer.
Definition: StSsdWafer.cc:229
Int_t setMatcheds(ssdDimensions_st *dimensions, StSsdPoint *Point, StSsdCluster *pMatched, StSsdCluster *nMatched)
Definition: StSsdWafer.cc:2689
void addPackage(StSsdPackage *ptr)
Attaches the ptr package on that wafer.
Definition: StSsdWafer.cc:223
Int_t doClusterSplitting(StSsdClusterControl *clusterControl, Int_t iSide)
Definition: StSsdWafer.cc:395
Int_t doFindPackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl)
Definition: StSsdWafer.cc:492
void addStrip(StSsdStrip *ptr, Int_t iSide)
Definition: StSsdWafer.cc:201
void init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX)
Definition: StSsdWafer.cc:126
void doClusterisation(Int_t *numberOfCluster, StSsdClusterControl *clusterControl)
Definition: StSsdWafer.cc:270
Int_t geoMatched(ssdDimensions_st *dimensions, StSsdCluster *ptr1, StSsdCluster *ptr2)
Determines if two clusters are geometricaly compatible.
Definition: StSsdWafer.cc:2674
Int_t doFindCluster(StSsdClusterControl *clusterControl, Int_t iSide)
Does the cluster finding.
Definition: StSsdWafer.cc:309