71 #include "StSsdUtil/StSsdWafer.hh"
74 #include "StMessMgr.h"
77 StSsdWafer::StSsdWafer(Int_t nid) : TGeoHMatrix(), mDebug(0) {
78 memset(first, 0, last-first);
91 StSsdWafer::~StSsdWafer() {
102 void StSsdWafer::Reset() {
128 if (rId != mId) cout<<
" Can not initialize wafer number : "<<mId<<
" with "<<rId<<
"\n";
130 SetName(Form(
"R%04i",rId));
141 void StSsdWafer::debugStrips()
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);
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);
164 void StSsdWafer::debugClusters()
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);
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);
204 { mStripN->addNewStrip(ptr); }
206 { mStripP->addNewStrip(ptr); }
215 { mClusterN->addNewCluster(ptr); }
217 { mClusterP->addNewCluster(ptr); }
224 { mPackage->addNewPackage(ptr); }
230 { mPoint->addNewPoint(ptr); }
232 void StSsdWafer::setPedestalSigmaStrip(Int_t iStrip, Int_t iSide, Int_t iPedestal, Int_t iSigma,
StSsdDynamicControl *dynamicControl)
235 { mStripN->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
237 { mStripP->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
245 mStripP->sortStrip();
246 mStripN->sortStrip();
254 mClusterP->sortCluster();
255 mClusterN->sortCluster();
262 { mPoint->sortPoint(); }
286 cleanListStrip = myStripList;
288 StSsdStrip *copyStrip = cleanListStrip->first();
289 int size = cleanListStrip->getSize();
290 for(Int_t i=0;i<size;i++){
293 copyStrip = myStripList->next(copyStrip);
294 if((myStrip->getSigma()==0)||(myStrip->getDigitSig()<lowCut*myStrip->getSigma())){
295 cleanListStrip->removeStrip(myStrip);
317 CurrentStripList = mStripP;
318 CurrentClusterList = mClusterP;
321 CurrentStripList = mStripN;
322 CurrentClusterList = mClusterN;
325 if(!CurrentStripList->getSize())
return 0;
330 doCleanListStrip(CurrentStripList);
332 StSsdStrip *CurrentStrip = CurrentStripList->first();
335 StSsdStrip *tmpStrip = CurrentStripList->first();
336 for(Int_t i = 0; i<CurrentStripList->getSize(); i++)
337 { tmpStrip = CurrentStripList->next(tmpStrip); }
341 if((CurrentStrip->getDigitSig()>(clusterControl->getHighCut()*CurrentStrip->getSigma()))&&(CurrentStrip->getSigma()>0))
346 newCluster->update(CurrentStrip,1.);
347 ScanStrip = CurrentStripList->prev(CurrentStrip);
350 if(((ScanStrip->getNStrip())-((CurrentStripList->next(ScanStrip))->getNStrip()))==-1)
352 newCluster->update(ScanStrip,1.);
353 ScanStrip = CurrentStripList->prev(ScanStrip);
358 ScanStrip = CurrentStripList->next(CurrentStrip);
361 if(((ScanStrip->getNStrip())-((CurrentStripList->prev(ScanStrip))->getNStrip()))==1)
363 newCluster->update(ScanStrip,1.);
364 ScanStrip = CurrentStripList->next(ScanStrip);
365 if (!ScanStrip) atTheEnd = 1;
369 LastScanStrip = ScanStrip;
373 CurrentClusterList->addNewCluster(newCluster);
375 { CurrentStrip = LastScanStrip; }
379 { CurrentStrip = 0; }
381 { CurrentStrip = CurrentStripList->next(CurrentStrip); }
385 { CurrentStrip = CurrentStripList->next(CurrentStrip); }
403 CurrentStripList = mStripP;
404 CurrentClusterList = mClusterP;
407 CurrentStripList = mStripN;
408 CurrentClusterList = mClusterN;
412 Int_t ClusterListSize = CurrentClusterList->getSize();
413 if(!ClusterListSize)
return 0;
416 StSsdCluster *CurrentCluster = CurrentClusterList->first();
418 for(iCluster = 0 ; iCluster < ClusterListSize ; iCluster++)
421 Int_t *ListAdc = CurrentStripList->getListAdc(CurrentCluster->getFirstStrip(),CurrentCluster->getClusterSize());
422 Int_t toBeDeleted = CurrentClusterList->splitCluster(clusterControl,CurrentCluster,ListAdc,CurrentStripList);
426 CurrentCluster = CurrentClusterList->next(CurrentCluster);
427 CurrentClusterList->removeCluster(TempCluster);
431 CurrentCluster = CurrentClusterList->next(CurrentCluster);
436 CurrentClusterList->renumCluster();
437 return CurrentClusterList->getSize();
448 Int_t rejected_sideP = 0 ;
449 Int_t rejected_sideN = 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);
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;
458 Int_t StSsdWafer::doLorentzShiftSide(Int_t side,Float_t shift,ssdDimensions_st *dimensions){
460 Float_t pitch = dimensions[0].stripPitch;
461 Float_t waferActLength = dimensions[0].waferHalfActLength;
465 CurrentClusterList = mClusterP;
468 CurrentClusterList = mClusterN;
472 Int_t ClusterListSize = CurrentClusterList->getSize();
473 if(!ClusterListSize)
return 0;
475 Int_t n_rejected = 0;
476 StSsdCluster *CurrentCluster = CurrentClusterList->first();
478 for(iCluster = 0 ; iCluster < ClusterListSize ; iCluster++)
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);
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;
514 Int_t keepPackage = 0;
516 currentPackageList = mPackage;
517 currentClusterP = mClusterP->first();
518 currentClusterN = mClusterN->first();
520 if (!mClusterP->getSize() || !mClusterN->getSize())
return 0;
523 while (currentClusterP)
527 scanClusterP = currentClusterP ;
528 currentPackage->addNewMatched(currentClusterP, maxMatchedInPackage);
529 currentPackage->addKindPackage(numCurrentClusterP+1,0, maxMatchedInPackage);
530 scanClusterN = currentClusterN ;
533 if (
geoMatched(dimensions, scanClusterP, scanClusterN))
536 currentPackage->addNewMatched(scanClusterN, maxMatchedInPackage);
537 currentPackage->addKindPackage(numLastMatchedN+1,1, maxMatchedInPackage);
538 lastMatchedN = scanClusterN;
541 scanClusterN = mClusterN->next(scanClusterN);
543 if (!(numScanClusterP == mClusterP->getSize()-1))
545 scanClusterP = mClusterP->next(scanClusterP);
547 scanClusterN = lastMatchedN;
548 numScanClusterN = numLastMatchedN;
551 if (
geoMatched(dimensions, scanClusterP, scanClusterN))
554 nextMatchedN = scanClusterN;
556 numNextMatchedN = numScanClusterN;
558 scanClusterN = mClusterN->prev(scanClusterN);
562 numCurrentClusterP = 0;
563 numCurrentClusterN = 0;
570 currentPackage->purgePackage();
574 currentClusterN = mClusterN->next(lastMatchedN);
578 newPackage->takeMatcheds(currentPackage);
579 currentPackageList->addNewPackage(newPackage);
580 currentPackage->purgePackage();
587 currentClusterN = nextMatchedN;
588 numCurrentClusterP++;
589 numCurrentClusterN++;
590 numLastMatchedN = numNextMatchedN;
598 newPackage->takeMatcheds(currentPackage);
599 currentPackageList->addNewPackage(newPackage);
600 currentPackage->purgePackage();
604 currentClusterP = mClusterP->next(currentClusterP);
606 delete currentPackage;
610 Int_t StSsdWafer::doSolvePerfect(ssdDimensions_st *dimensions,
StSsdClusterControl *clusterControl,Float_t CalibArray)
614 char *currentKind = 0;
615 currentPackage = mPackage->first();
616 while(currentPackage)
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();
624 if(!strcmp(currentKind,
"1p1n"))
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);
635 currentPackage=mPackage->next(currentPackage);
644 currentPerfect = mPoint->first();
645 while(currentPerfect)
647 store += currentPerfect->getDe(1);
648 currentPerfect = mPoint->next(currentPerfect);
650 mPerfectMean = store/nPerfectPoint;
653 currentPerfect = mPoint->first();
654 while(currentPerfect)
656 store += (currentPerfect->getDe(1)-mPerfectMean)*(currentPerfect->getDe(1)-mPerfectMean);
657 currentPerfect=mPoint->next(currentPerfect);
659 mPerfectSigma = store/nPerfectPoint;
662 Int_t StSsdWafer::doSolvePackage(ssdDimensions_st *dimensions,
StSsdClusterControl *clusterControl,Float_t CalibArray)
666 char *currentKind = 0;
667 currentPackage = mPackage->first();
668 while(currentPackage)
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();
675 if(!strcmp(currentKind,
"1p1n"))
679 else if(!strcmp(currentKind,
"1p1n2n"))
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);
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);
695 else if(!strcmp(currentKind,
"1p1n2p1n"))
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);
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);
711 else if(!strcmp(currentKind,
"1p1n2n3n"))
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);
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);
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);
733 else if(!strcmp(currentKind,
"1p1n2p1n3p1n"))
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);
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);
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);
755 else if(!strcmp(currentKind,
"1p1n2n2p2n"))
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);
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);
771 else if(!strcmp(currentKind,
"1p1n2p1n2n"))
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);
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);
787 else if(!strcmp(currentKind,
"1p1n2n2p1n2n"))
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);
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);
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);
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);
810 Double_t setA[2], setB[2], setC[2], setD[2];
811 Double_t probAD, probBC;
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]))
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;
828 mPoint->addNewPoint(newPointA);
829 mPoint->addNewPoint(newPointD);
833 mPoint->addNewPoint(newPointB);
834 mPoint->addNewPoint(newPointC);
841 mPoint->addNewPoint(newPointA);
842 mPoint->addNewPoint(newPointD);
843 mPoint->addNewPoint(newPointB);
844 mPoint->addNewPoint(newPointC);
846 newPointA->setFlag(
int(100*probAD));
847 newPointB->setFlag(
int(100*probBC));
848 newPointC->setFlag(
int(100*probBC));
849 newPointD->setFlag(
int(100*probAD));
854 else if(!strcmp(currentKind,
"1p1n2n2p2n3n"))
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);
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);
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);
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);
877 Double_t setA[2], setD[2];
878 Double_t setAB[2], setCD[2];
879 Double_t probABD, probACD;
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)
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);
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);
913 else if(!strcmp(currentKind,
"1p1n2p1n2n3p2n"))
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);
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);
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);
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);
936 Double_t setA[2], setD[2];
937 Double_t setAB[2], setCD[2];
938 Double_t probABD, probACD;
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)
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);
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);
972 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n"))
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);
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);
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);
989 StSsdPoint *newPointD =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
990 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
993 StSsdPoint *newPointE =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
994 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(3));
998 Double_t setA[2], setD[2], setE[2];
999 Double_t setAB[2], setAC[2], setDE[2];
1000 Double_t probABE, probACD, probADE;
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))
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);
1031 else if ((probACD > probABE)&&(probACD > probADE))
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);
1039 else if ((probADE > probABE)&&(probADE > probACD))
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);
1051 else if(!strcmp(currentKind,
"1p1n2p1n2n3p1n2n"))
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);
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);
1063 StSsdPoint *newPointC =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1064 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
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);
1072 StSsdPoint *newPointE =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1073 setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(4));
1077 Double_t setA[2], setC[2], setE[2];
1078 Double_t setAB[2], setAD[2], setCE[2];
1079 Double_t probABE, probACD, probACE;
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))
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);
1109 else if ((probACD > probABE)&&(probACD > probACE))
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);
1117 else if ((probACE > probABE)&&(probACE > probACD))
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);
1129 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n"))
1131 StSsdPoint *newPointA =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1132 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1135 StSsdPoint *newPointB =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1136 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
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);
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);
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);
1155 Double_t setA[2], setB[2], setE[2];
1156 Double_t setAB[2], setCE[2], setDE[2];
1157 Double_t probABE, probADE, probBCE;
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))
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);
1188 else if ((probADE > probABE)&&(probADE > probBCE))
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);
1196 else if ((probBCE > probABE)&&(probBCE > probADE))
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);
1207 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p2n"))
1209 StSsdPoint *newPointA =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1210 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
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);
1218 StSsdPoint *newPointC =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1219 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
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);
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);
1233 Double_t setA[2], setC[2], setE[2];
1234 Double_t setAC[2], setBE[2], setDE[2];
1235 Double_t probACE, probADE, probBCE;
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))
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);
1266 else if ((probADE > probACE)&&(probADE > probBCE))
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);
1274 else if ((probBCE > probACE)&&(probBCE > probADE))
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);
1285 else if(!strcmp(currentKind,
"1p1n2p1n2n3n"))
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);
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);
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);
1308 else if(!strcmp(currentKind,
"1p1n2n2p2n3p2n"))
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);
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);
1322 StSsdPoint *newPointD =
new StSsdPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1323 setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(2));
1324 newPointD->setEnergyLossCorrected(Adc[5], Adc[2]-Adc[3],CalibArray);
1325 newPointD->setFlag(100);
1326 mPoint->addNewPoint(newPointD);
1331 else if(!strcmp(currentKind,
"1p1n2n3n2p3n"))
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);
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);
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);
1354 else if(!strcmp(currentKind,
"1p1n2p1n3p1n2n"))
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);
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);
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);
1377 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n"))
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);
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);
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);
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);
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);
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);
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];
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]));
1448 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p1n2n"))
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);
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);
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);
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);
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);
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);
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];
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]));
1519 else if(!strcmp(currentKind,
"1p1n2n2p2n3n3p3n"))
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);
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);
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);
1542 else if(!strcmp(currentKind,
"1p1n2p1n2n3p2n3n"))
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);
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);
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);
1565 else if(!strcmp(currentKind,
"1p1n2n2p2n3n3p2n3n"))
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);
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);
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);
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);
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);
1594 Double_t setC[2], setD[2], setE[2], setF[2];
1595 Double_t probACF, probADE;
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;
1610 mPoint->addNewPoint(newPointA);
1611 mPoint->addNewPoint(newPointC);
1612 mPoint->addNewPoint(newPointF);
1616 mPoint->addNewPoint(newPointA);
1617 mPoint->addNewPoint(newPointD);
1618 mPoint->addNewPoint(newPointE);
1620 newPointC->setFlag(
int(100*probACF));
1621 newPointD->setFlag(
int(100*probADE));
1622 newPointE->setFlag(
int(100*probADE));
1623 newPointF->setFlag(
int(100*probACF));
1627 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p2n3n"))
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);
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);
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);
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);
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);
1656 Double_t setC[2], setD[2], setE[2], setF[2];
1657 Double_t probACF, probADE;
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;
1672 mPoint->addNewPoint(newPointA);
1673 mPoint->addNewPoint(newPointC);
1674 mPoint->addNewPoint(newPointF);
1678 mPoint->addNewPoint(newPointA);
1679 mPoint->addNewPoint(newPointD);
1680 mPoint->addNewPoint(newPointE);
1682 newPointC->setFlag(
int(100*probACF));
1683 newPointD->setFlag(
int(100*probADE));
1684 newPointE->setFlag(
int(100*probADE));
1685 newPointF->setFlag(
int(100*probACF));
1689 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p2n3n"))
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);
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);
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);
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);
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);
1718 Double_t setA[2], setB[2], setC[2], setD[2];
1719 Double_t probADF, probBCF;
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;
1734 mPoint->addNewPoint(newPointA);
1735 mPoint->addNewPoint(newPointD);
1736 mPoint->addNewPoint(newPointF);
1740 mPoint->addNewPoint(newPointB);
1741 mPoint->addNewPoint(newPointC);
1742 mPoint->addNewPoint(newPointF);
1744 newPointA->setFlag(
int(100*probADF));
1745 newPointB->setFlag(
int(100*probBCF));
1746 newPointC->setFlag(
int(100*probBCF));
1747 newPointD->setFlag(
int(100*probADF));
1751 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p3n"))
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);
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);
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);
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);
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);
1781 Double_t setA[2], setB[2], setC[2], setD[2];
1782 Double_t probADF, probBCF;
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;
1797 mPoint->addNewPoint(newPointA);
1798 mPoint->addNewPoint(newPointD);
1799 mPoint->addNewPoint(newPointF);
1803 mPoint->addNewPoint(newPointB);
1804 mPoint->addNewPoint(newPointC);
1805 mPoint->addNewPoint(newPointF);
1807 newPointA->setFlag(
int(100*probADF));
1808 newPointB->setFlag(
int(100*probBCF));
1809 newPointC->setFlag(
int(100*probBCF));
1810 newPointD->setFlag(
int(100*probADF));
1814 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n3p3n"))
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);
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);
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);
1838 else if(!strcmp(currentKind,
"1p1n2p1n2n3p1n2n3n"))
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);
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);
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);
1862 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n3p2n3n"))
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);
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);
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);
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);
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);
1891 Double_t setD[2], setE[2], setF[2], setG[2];
1892 Double_t probADG, probAEF;
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;
1907 mPoint->addNewPoint(newPointA);
1908 mPoint->addNewPoint(newPointD);
1909 mPoint->addNewPoint(newPointG);
1913 mPoint->addNewPoint(newPointA);
1914 mPoint->addNewPoint(newPointE);
1915 mPoint->addNewPoint(newPointF);
1917 newPointD->setFlag(
int(100*probADG));
1918 newPointE->setFlag(
int(100*probAEF));
1919 newPointF->setFlag(
int(100*probAEF));
1920 newPointG->setFlag(
int(100*probADG));
1925 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p1n2n3n"))
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);
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);
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);
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);
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);
1954 Double_t setC[2], setD[2], setF[2], setG[2];
1955 Double_t probACG, probADF;
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;
1970 mPoint->addNewPoint(newPointA);
1971 mPoint->addNewPoint(newPointC);
1972 mPoint->addNewPoint(newPointG);
1976 mPoint->addNewPoint(newPointA);
1977 mPoint->addNewPoint(newPointD);
1978 mPoint->addNewPoint(newPointF);
1980 newPointC->setFlag(
int(100*probACG));
1981 newPointD->setFlag(
int(100*probADF));
1982 newPointF->setFlag(
int(100*probADF));
1983 newPointG->setFlag(
int(100*probACG));
1988 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p1n2n3n"))
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);
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);
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);
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);
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);
2017 Double_t setA[2], setB[2], setC[2], setD[2];
2018 Double_t probADG, probBCG;
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;
2033 mPoint->addNewPoint(newPointA);
2034 mPoint->addNewPoint(newPointD);
2035 mPoint->addNewPoint(newPointG);
2039 mPoint->addNewPoint(newPointB);
2040 mPoint->addNewPoint(newPointC);
2041 mPoint->addNewPoint(newPointG);
2043 newPointA->setFlag(
int(100*probADG));
2044 newPointB->setFlag(
int(100*probBCG));
2045 newPointC->setFlag(
int(100*probBCG));
2046 newPointD->setFlag(
int(100*probADG));
2051 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p3n"))
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);
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);
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);
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);
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);
2080 Double_t setA[2], setB[2], setD[2], setE[2];
2081 Double_t probAEG, probBDG;
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;
2096 mPoint->addNewPoint(newPointA);
2097 mPoint->addNewPoint(newPointE);
2098 mPoint->addNewPoint(newPointG);
2102 mPoint->addNewPoint(newPointB);
2103 mPoint->addNewPoint(newPointD);
2104 mPoint->addNewPoint(newPointG);
2106 newPointA->setFlag(
int(100*probAEG));
2107 newPointB->setFlag(
int(100*probBDG));
2108 newPointD->setFlag(
int(100*probBDG));
2109 newPointE->setFlag(
int(100*probAEG));
2114 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p3n"))
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);
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);
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);
2137 else if(!strcmp(currentKind,
"1p1n2n2p2n3p2n3n"))
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);
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);
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);
2160 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p2n3n"))
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);
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);
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);
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);
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);
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);
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);
2198 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2];
2199 Double_t probADG, probAEF, probBCG;
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))
2222 mPoint->addNewPoint(newPointA);
2223 mPoint->addNewPoint(newPointD);
2224 mPoint->addNewPoint(newPointG);
2226 else if ((probAEF > probADG)&&(probAEF > probBCG))
2228 mPoint->addNewPoint(newPointA);
2229 mPoint->addNewPoint(newPointE);
2230 mPoint->addNewPoint(newPointF);
2232 else if ((probBCG > probADG)&&(probBCG > probAEF))
2234 mPoint->addNewPoint(newPointB);
2235 mPoint->addNewPoint(newPointC);
2236 mPoint->addNewPoint(newPointG);
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)));
2249 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p2n3n"))
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);
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);
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);
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);
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);
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);
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);
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);
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;
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)));
2328 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p1n2n3n"))
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);
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);
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);
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);
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);
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);
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);
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);
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;
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)));
2407 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p1n2n3n"))
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
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)));
2495 else cout<<
" Warning unsolved case ("<<currentKind<<
")\n";
2497 currentPackage=mPackage->next(currentPackage);
2502 Int_t StSsdWafer::convertDigitToAnalog(Double_t pairCreationEnergy)
2507 currentPoint->setDe(currentPoint->getDe(0)*pairCreationEnergy,0);
2508 currentPoint->setDe(currentPoint->getDe(1)*pairCreationEnergy,1);
2509 currentPoint = mPoint->next(currentPoint);
2514 Int_t StSsdWafer::convertUFrameToLocal(ssdDimensions_st *dimensions)
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);
2527 Int_t StSsdWafer::convertLocalToGlobal() {
2530 while(currentPoint) {
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);
2542 Int_t StSsdWafer::convertGlobalToLocal() {
2543 Int_t localSize = (this->mPoint)->getSize();
2544 if (!localSize)
return 0;
2546 for (Int_t i = 0; i < localSize; i++) {
2547 Double_t xg[3] = {temp->getXg(0), temp->getXg(1), temp->getXg(2)};
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);
2558 Int_t StSsdWafer::convertLocalToUFrame(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge, Float_t Theta)
2560 Int_t localSize = (mPoint)->getSize();
2561 if (!localSize)
return 0;
2564 for (Int_t i = 0; i < localSize; i++)
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);
2575 StSsdPointList* StSsdWafer::getDeadHits(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge,Float_t Test)
2577 StSsdPointList *listDeadBorder = getNonActivePointBorder(ActiveLargeEdge,ActiveSmallEdge);
2578 StSsdPointList *listDeadTriangle = getNonActivePointTriangle(Test);
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;
2589 void StSsdWafer::convertToStrip(Float_t Pitch,
2590 Int_t nStripPerSide,
2591 Double_t pairCreationEnergy,
2592 Int_t nstripInACluster,
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)
2602 convertHitToStrip(Pitch,
2613 convertAnalogToDigit(pairCreationEnergy);
2614 mStripP->sortStrip();
2615 mStripN->sortStrip();
2618 Int_t StSsdWafer::printborder()
2621 printf(
"Wafer = %d \n",mId);
2622 Double_t actives[4][3],templs[4][3];
2623 Double_t activee[4][3],temple[4][3];
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;
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]);
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]);
2641 printf(
"%seSsdLadder%d set {",xyz[i],mId-7100);
2642 for (Int_t j = 0; j < 4; j++) printf(
"%.2f ",temple[j][i]);
2649 StSsdWafer::StSsdWafer(
const StSsdWafer & originalWafer)
2651 memcpy (first, originalWafer.first, last-first);
2663 memset(first, 0, last-first);
2664 mId = originalWafer.mId;
2665 SetName(originalWafer.GetName());
2666 SetRotation(originalWafer.GetRotationMatrix());
2667 SetTranslation(originalWafer.GetTranslation());
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) )
2680 else if((ptr2->getStripMean() > ( ptr1->getStripMean() - numStrip))
2681 && (ptr2->getStripMean() < (ptr1->getStripMean() + numStrip)))
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());
2697 Int_t pHitIndex = 0;
2698 Int_t nHitIndex = 0;
2699 Int_t sptHitIndex = 0;
2700 for (pHitIndex = 0; pHitIndex < SSD_MAXIDMCHIT; pHitIndex++)
2702 for (nHitIndex = 0; nHitIndex < SSD_MAXIDMCHIT; nHitIndex++)
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++);
2716 Double_t mean = clusterControl->getMatchMean();
2717 Double_t sigm = clusterControl->getMatchSigma();
2718 return TMath::Gaus(x, mean, sigm, 1);
2721 void StSsdWafer::addHit(Int_t rNId , Int_t rMcHit, Int_t rMcTrack, Float_t *rXg , Float_t rDe, Float_t *p)
2723 Float_t *alpha =
new float[2];
2727 (mPoint)->addNewPoint(tmpPoint);
2731 StSsdPointList* StSsdWafer::getNonActivePointBorder(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge)
2733 Int_t localSize = (mPoint)->getSize();
2736 if (!localSize)
return deadPoints;
2739 for (Int_t i = 0; i < localSize; i++)
2741 if((temp->getXl(0) >(ActiveLargeEdge/2.)) || (temp->getXl(0) < (-ActiveLargeEdge/2.)) ||
2742 (temp->getXl(1) >(ActiveSmallEdge/2.)) || (temp->getXl(1) < (-ActiveSmallEdge/2.)))
2746 deadPoints->addNewPoint(badPoint);
2748 temp = (mPoint)->next(temp);
2753 StSsdPointList* StSsdWafer::getNonActivePointTriangle(Float_t Test)
2756 Int_t localSize = (mPoint)->getSize();
2759 if (!localSize)
return deadPoints;
2762 for (Int_t i = 0; i < localSize; i++)
2764 if (temp->getPositionU(0) < -1.*Test && temp->getPositionU(1) < -1.*Test)
2768 deadPoints->addNewPoint(badPoint);
2770 temp = (mPoint)->next(temp);
2776 Double_t StSsdWafer::myErf(Double_t x)
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;
2785 Double_t z = ((x) < 0. ? -(x) : (x));
2787 if (z <= 0)
return (1.-v);
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)))))))));
2791 if (x < 0) v = 2.-v;
2795 void StSsdWafer::convertHitToStrip(Float_t Pitch,
2796 Int_t nStripPerSide,
2797 Int_t nstripInACluster,
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)
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};
2811 Int_t *tabInd =
new Int_t[nstripInACluster];
2812 Float_t *tabDe =
new Float_t[nstripInACluster];
2815 Int_t localSize = (mPoint)->getSize();
2816 for (Int_t iPoint = 0; iPoint < localSize; iPoint++)
2818 for (Int_t iSide = 0; iSide < 2; iSide++)
2820 for (Int_t v = 0 ; v < nstripInACluster; v++)
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.);
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];
2847 for (Int_t st = 0; st < nstripInACluster; st++)
2849 if ( tabInd[st] > 0 && tabInd[st] < nStripPerSide+1 )
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]);
2856 mStripP->updateStrip(newStrip);
2859 mStripN->updateStrip(newStrip);
2865 ptr = (mPoint)->next(ptr);
2871 void StSsdWafer::convertAnalogToDigit(Double_t pairCreationEnergy)
2873 const Double_t ConversionFactor = 1./pairCreationEnergy;
2875 Int_t localSize = mStripP->getSize();
2878 for (i = 0; i < localSize; i++)
2880 curr->setDigitSig((
int)(curr->getAnalogSig()*ConversionFactor));
2881 curr = mStripP->next(curr);
2883 localSize = mStripN->getSize();
2884 curr = mStripN->first();
2885 for (i = 0; i < localSize; i++)
2887 curr->setDigitSig((
int)(curr->getAnalogSig()*ConversionFactor));
2888 curr = mStripN->next(curr);
2892 float* StSsdWafer::findAngle(Float_t *p, Float_t *alpha)
2895 Float_t pT[3],pN[3],pD[3];
2904 for (i = 0; i < 3; i++)
2910 for (i = 0; i < 3; i++)
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]);
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]));
2924 alpha[0] = acos(npN/npDN);
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];
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];
2936 void StSsdWafer::addNoiseToStripSignal(
StSpaNoise *ptr, Int_t iSide)
2939 { mNoiseN->addNewNoise(ptr); }
2941 { mNoiseP->addNewNoise(ptr); }
2944 void StSsdWafer::setIsActive(Int_t rIsActive, Int_t iSide, Int_t rNStrip)
2947 { mNoiseN->setIsActive(rIsActive, rNStrip); }
2949 { mNoiseP->setIsActive(rIsActive, rNStrip); }
2952 void StSsdWafer::sortNoise()
2954 mNoiseP->sortStrip();
2955 mNoiseN->sortStrip();
2958 void StSsdWafer::addNoiseToStripSignal(
long nElectronInAMip,
long adcDynamic)
2960 mNoiseP->addSignal(mStripP, nElectronInAMip, adcDynamic);
2961 mNoiseN->addSignal(mStripN, nElectronInAMip, adcDynamic);
2964 void StSsdWafer::pedestalSubstraction()
2966 mNoiseP->substractPedestal();
2967 mNoiseN->substractPedestal();
2970 void StSsdWafer::zeroSubstraction()
2972 mNoiseP->zeroSubstraction();
2973 mNoiseN->zeroSubstraction();
2976 void StSsdWafer::convertAnalogToDigit(Long_t nElectronInAMip,Long_t adcDynamic,
2977 Long_t nbitEncoding, Float_t daqCutValue)
2979 mNoiseP->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2980 nbitEncoding,daqCutValue);
2981 mNoiseN->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2982 nbitEncoding,daqCutValue);
2985 void StSsdWafer::updateStripList()
2987 mStripP->updateStripList(mNoiseP);
2988 mStripN->updateStripList(mNoiseN);
2991 void StSsdWafer::UndoLorentzShift(
StSsdPoint *ptr,Int_t iSide,Float_t mShift_hole,Float_t mShift_elec,Float_t pitch)
2993 Float_t tempPosition = ptr->getPositionU(iSide);
2995 ptr->setPositionU(tempPosition+mShift_hole,iSide);
2999 ptr->setPositionU(tempPosition+mShift_elec,iSide);
void addCluster(StSsdCluster *ptr, Int_t iSide)
Attaches the ptr cluster on the iSide of the wafer.
void doLorentzShift(ssdDimensions_st *dimensions, Float_t mShift_hole, Float_t mShift_elec)
void addPoint(StSsdPoint *ptr)
Attaches the ptr point on that wafer.
Int_t setMatcheds(ssdDimensions_st *dimensions, StSsdPoint *Point, StSsdCluster *pMatched, StSsdCluster *nMatched)
void addPackage(StSsdPackage *ptr)
Attaches the ptr package on that wafer.
Int_t doClusterSplitting(StSsdClusterControl *clusterControl, Int_t iSide)
Int_t doFindPackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl)
void addStrip(StSsdStrip *ptr, Int_t iSide)
void init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX)
void doClusterisation(Int_t *numberOfCluster, StSsdClusterControl *clusterControl)
Int_t geoMatched(ssdDimensions_st *dimensions, StSsdCluster *ptr1, StSsdCluster *ptr2)
Determines if two clusters are geometricaly compatible.
Int_t doFindCluster(StSsdClusterControl *clusterControl, Int_t iSide)
Does the cluster finding.