42 #include "StSstUtil/StSstWafer.hh"
45 #include "StMessMgr.h"
47 StSstWafer::StSstWafer(Int_t nid) : TGeoHMatrix(), mDebug(0) {
48 memset(first, 0, last-first);
61 StSstWafer::~StSstWafer() {
72 void StSstWafer::Reset() {
91 void StSstWafer::init(Int_t rId, Double_t *rD, Double_t *rN, Double_t *rT, Double_t *rX)
93 if (rId != mId) {LOG_INFO<<
" Can not initialize wafer number : "<<mId<<
" with "<<rId<<
"\n";}
95 SetName(Form(
"R%04i",rId));
106 void StSstWafer::debugStrips()
109 LOG_INFO<<
"List of "<<mStripP->getSize()<<
" strips on the P side "<<endm;
110 if (mStripP->getSize()>0) currentStripP = mStripP->first();
111 for (Int_t i=0;i<mStripP->getSize();i++) {
112 LOG_INFO<<
" id,sig,noise : "<<currentStripP->getNStrip()
113 <<
" "<<currentStripP->getDigitSig()
114 <<
" "<<currentStripP->getSigma()<<endm;
115 if (currentStripP!=mStripP->last()) currentStripP = mStripP->next(currentStripP);
119 LOG_INFO<<
"List of "<<mStripN->getSize()<<
" strips on the N side "<<endm;
120 if (mStripN->getSize()>0) currentStripN = mStripN->first();
121 for (Int_t i=0;i<mStripN->getSize();i++) {
122 LOG_INFO<<
" id,sig,noise : "<<currentStripN->getNStrip()
123 <<
" "<<currentStripN->getDigitSig()
124 <<
" "<<currentStripN->getSigma()<<endm;
125 if (currentStripN!=mStripN->last()) currentStripN = mStripN->next(currentStripN);
129 void StSstWafer::debugClusters()
132 LOG_INFO<<
"List of "<<mClusterP->getSize()<<
" clusters on the P side "<<endm;
133 if (mClusterP->getSize()>0) currentClusterP = mClusterP->first();
134 for (Int_t i=0;i<mClusterP->getSize();i++) {
135 LOG_INFO<<
"N,Size,FirstStrip,StripMean,TotAdc,FirstAdc,LastAdc,TotNoise : "<<currentClusterP->getNCluster()
136 <<
" "<<currentClusterP->getClusterSize()
137 <<
" "<<currentClusterP->getFirstStrip()
138 <<
" "<<currentClusterP->getStripMean()
139 <<
" "<<currentClusterP->getTotAdc()
140 <<
" "<<currentClusterP->getFirstAdc()
141 <<
" "<<currentClusterP->getLastAdc()
142 <<
" "<<currentClusterP->getTotNoise()<<endm;
143 if (currentClusterP!=mClusterP->last()) currentClusterP = mClusterP->next(currentClusterP);
147 LOG_INFO<<
"List of "<<mClusterN->getSize()<<
" clusters on the P side "<<endm;
148 if (mClusterN->getSize()>0) currentClusterN = mClusterN->first();
149 for (Int_t i=0;i<mClusterN->getSize();i++) {
150 LOG_INFO<<
"N,Size,FirstStrip,StripMean,TotAdc,FirstAdc,LastAdc,TotNoise : "<<currentClusterN->getNCluster()
151 <<
" "<<currentClusterN->getClusterSize()
152 <<
" "<<currentClusterN->getFirstStrip()
153 <<
" "<<currentClusterN->getStripMean()
154 <<
" "<<currentClusterN->getTotAdc()
155 <<
" "<<currentClusterN->getFirstAdc()
156 <<
" "<<currentClusterN->getLastAdc()
157 <<
" "<<currentClusterN->getTotNoise()<<endm;
158 if (currentClusterN!=mClusterN->last()) currentClusterN = mClusterN->next(currentClusterN);
168 { mStripN->addNewStrip(ptr); }
170 { mStripP->addNewStrip(ptr); }
179 { mClusterN->addNewCluster(ptr); }
181 { mClusterP->addNewCluster(ptr); }
188 { mPackage->addNewPackage(ptr); }
194 { mPoint->addNewPoint(ptr); }
196 void StSstWafer::setPedestalSigmaStrip(Int_t iStrip, Int_t iSide, Int_t iPedestal, Int_t iSigma,
StSstDynamicControl *dynamicControl)
199 { mStripN->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
201 { mStripP->setPedestalSigma(iStrip, iPedestal, iSigma, dynamicControl); }
209 mStripP->sortStrip();
210 mStripN->sortStrip();
218 mClusterP->sortCluster();
219 mClusterN->sortCluster();
226 { mPoint->sortPoint(); }
248 cleanListStrip = myStripList;
250 StSstStrip *copyStrip = cleanListStrip->first();
251 int size = cleanListStrip->getSize();
252 for(Int_t i=0;i<size;i++){
254 copyStrip = myStripList->next(copyStrip);
255 if((myStrip->getSigma()==0)||(myStrip->getDigitSig()<lowCut*myStrip->getSigma())){
256 cleanListStrip->removeStrip(myStrip);
289 CurrentStripList = mStripP;
290 CurrentClusterList = mClusterP;
293 CurrentStripList = mStripN;
294 CurrentClusterList = mClusterN;
298 if(!CurrentStripList)
return 0;
299 if(!CurrentStripList->getSize())
return 0;
306 StSstStrip *CurrentStrip = CurrentStripList->first();
309 StSstStrip *tmpStrip = CurrentStripList->first();
310 for(Int_t i = 0; i<CurrentStripList->getSize(); i++)
311 { tmpStrip = CurrentStripList->next(tmpStrip); }
315 if(CurrentStrip->getDigitSig()> clusterControl->getHighCut())
320 newCluster->update(CurrentStrip,1.);
321 ScanStrip = CurrentStripList->prev(CurrentStrip);
324 if(((ScanStrip->getNStrip())-((CurrentStripList->next(ScanStrip))->getNStrip()))==-1)
326 newCluster->update(ScanStrip,1.);
327 ScanStrip = CurrentStripList->prev(ScanStrip);
332 ScanStrip = CurrentStripList->next(CurrentStrip);
335 if(((ScanStrip->getNStrip())-((CurrentStripList->prev(ScanStrip))->getNStrip()))==1)
337 newCluster->update(ScanStrip,1.);
338 ScanStrip = CurrentStripList->next(ScanStrip);
339 if (!ScanStrip) atTheEnd = 1;
343 LastScanStrip = ScanStrip;
347 CurrentClusterList->addNewCluster(newCluster);
349 { CurrentStrip = LastScanStrip; }
353 { CurrentStrip = 0; }
355 { CurrentStrip = CurrentStripList->next(CurrentStrip); }
359 { CurrentStrip = CurrentStripList->next(CurrentStrip); }
377 CurrentStripList = mStripP;
378 CurrentClusterList = mClusterP;
381 CurrentStripList = mStripN;
382 CurrentClusterList = mClusterN;
385 if(!CurrentClusterList)
return 0;
386 Int_t ClusterListSize = CurrentClusterList->getSize();
387 if(!ClusterListSize)
return 0;
390 StSstCluster *CurrentCluster = CurrentClusterList->first();
392 for(iCluster = 0 ; iCluster < ClusterListSize ; iCluster++)
395 Int_t *ListAdc = CurrentStripList->getListAdc(CurrentCluster->getFirstStrip(),CurrentCluster->getClusterSize());
396 Int_t toBeDeleted = CurrentClusterList->splitCluster(clusterControl,CurrentCluster,ListAdc,CurrentStripList);
400 CurrentCluster = CurrentClusterList->next(CurrentCluster);
401 CurrentClusterList->removeCluster(TempCluster);
405 CurrentCluster = CurrentClusterList->next(CurrentCluster);
410 CurrentClusterList->renumCluster();
411 return CurrentClusterList->getSize();
420 Float_t pitch = dimensions[0].stripPitch;
422 doLorentzShiftSide(mShift_hole, pitch, mClusterP);
424 doLorentzShiftSide(mShift_elec, pitch, mClusterN);
427 void StSstWafer::doLorentzShiftSide(Float_t shift,Float_t pitch,
StSstClusterList *currentList){
430 for(iCluster = 0 ; iCluster < currentList->getSize(); iCluster++){
431 Float_t StripMean = CurrentCluster->getStripMean();
432 CurrentCluster->setStripMean(StripMean-(shift/pitch));
433 CurrentCluster = currentList->next(CurrentCluster);
435 delete CurrentCluster;
451 Int_t maxMatchedInPackage = clusterControl->getClusterTreat();
452 Int_t numPackage = 0;
453 Int_t numUnMatched = 0;
454 Int_t numCurrentClusterP = 0;
455 Int_t numCurrentClusterN = 0;
456 Int_t numScanClusterP = 0;
457 Int_t numScanClusterN = 0;
458 Int_t numLastMatchedN = 0;
459 Int_t numNextMatchedN = 0;
461 Int_t keepPackage = 0;
463 currentPackageList = mPackage;
464 currentClusterP = mClusterP->first();
465 currentClusterN = mClusterN->first();
467 if (!mClusterP->getSize() || !mClusterN->getSize())
return 0;
470 while (currentClusterP)
474 scanClusterP = currentClusterP ;
475 currentPackage->addNewMatched(currentClusterP, maxMatchedInPackage);
476 currentPackage->addKindPackage(numCurrentClusterP+1,0, maxMatchedInPackage);
477 scanClusterN = currentClusterN ;
480 if (
geoMatched(dimensions, scanClusterP, scanClusterN))
483 currentPackage->addNewMatched(scanClusterN, maxMatchedInPackage);
484 currentPackage->addKindPackage(numLastMatchedN+1,1, maxMatchedInPackage);
485 lastMatchedN = scanClusterN;
488 scanClusterN = mClusterN->next(scanClusterN);
490 if (!(numScanClusterP == mClusterP->getSize()-1))
492 scanClusterP = mClusterP->next(scanClusterP);
494 scanClusterN = lastMatchedN;
495 numScanClusterN = numLastMatchedN;
498 if (
geoMatched(dimensions, scanClusterP, scanClusterN))
501 nextMatchedN = scanClusterN;
503 numNextMatchedN = numScanClusterN;
505 scanClusterN = mClusterN->prev(scanClusterN);
509 numCurrentClusterP = 0;
510 numCurrentClusterN = 0;
517 currentPackage->purgePackage();
521 currentClusterN = mClusterN->next(lastMatchedN);
523 newPackage->takeMatcheds(currentPackage);
524 currentPackageList->addNewPackage(newPackage);
525 currentPackage->purgePackage();
531 currentClusterN = nextMatchedN;
532 numCurrentClusterP++;
533 numCurrentClusterN++;
534 numLastMatchedN = numNextMatchedN;
540 newPackage->takeMatcheds(currentPackage);
541 currentPackageList->addNewPackage(newPackage);
542 currentPackage->purgePackage();
545 currentClusterP = mClusterP->next(currentClusterP);
547 delete currentPackage;
551 Int_t StSstWafer::doSolvePerfect(sstDimensions_st *dimensions,
StSstClusterControl *clusterControl,Float_t CalibArray)
555 char *currentKind = 0;
556 currentPackage = mPackage->first();
557 while(currentPackage)
559 currentKind = currentPackage->getKind();
560 Int_t numMatched = strlen(currentKind)/2;
561 Float_t *Adc =
new float[numMatched];
562 for(Int_t i=0;i<numMatched;i++)
563 Adc[i]=(currentPackage->getMatched(i))->getTotAdc();
565 if(!strcmp(currentKind,
"1p1n"))
567 StSstPoint *newPoint =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 11);
568 newPoint->setFlag(100);
569 setMatcheds(dimensions, newPoint, currentPackage->getMatched(0), currentPackage->getMatched(1));
570 newPoint->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
571 mPoint->addNewPoint(newPoint);
576 currentPackage=mPackage->next(currentPackage);
585 currentPerfect = mPoint->first();
586 while(currentPerfect)
588 store += currentPerfect->getDe(1);
589 currentPerfect = mPoint->next(currentPerfect);
591 mPerfectMean = store/nPerfectPoint;
594 currentPerfect = mPoint->first();
595 while(currentPerfect)
597 store += (currentPerfect->getDe(1)-mPerfectMean)*(currentPerfect->getDe(1)-mPerfectMean);
598 currentPerfect=mPoint->next(currentPerfect);
600 mPerfectSigma = store/nPerfectPoint;
603 Int_t StSstWafer::doSolvePackage(sstDimensions_st *dimensions,
StSstClusterControl *clusterControl,Float_t CalibArray)
607 char *currentKind = 0;
608 currentPackage = mPackage->first();
609 while(currentPackage)
611 currentKind = currentPackage->getKind();
612 Int_t numMatched = strlen(currentKind)/2;
613 Float_t *Adc =
new float[numMatched];
614 for(Int_t i=0;i<numMatched;i++) Adc[i]=(currentPackage->getMatched(i))->getTotAdc();
616 if(!strcmp(currentKind,
"1p1n"))
620 else if(!strcmp(currentKind,
"1p1n2n"))
622 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 12);
623 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
624 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2], Adc[1],CalibArray);
625 newPointA->setFlag(100);
626 mPoint->addNewPoint(newPointA);
628 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 12);
629 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
630 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
631 newPointB->setFlag(100);
632 mPoint->addNewPoint(newPointB);
636 else if(!strcmp(currentKind,
"1p1n2p1n"))
638 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 21);
639 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
640 newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
641 newPointA->setFlag(100);
642 mPoint->addNewPoint(newPointA);
644 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 21);
645 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
646 newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
647 newPointB->setFlag(100);
648 mPoint->addNewPoint(newPointB);
652 else if(!strcmp(currentKind,
"1p1n2n3n"))
654 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
655 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
656 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2]-Adc[3], Adc[1],CalibArray);
657 newPointA->setFlag(100);
658 mPoint->addNewPoint(newPointA);
660 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
661 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
662 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1]-Adc[3], Adc[2],CalibArray);
663 newPointB->setFlag(100);
664 mPoint->addNewPoint(newPointB);
666 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 13);
667 setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
668 newPointC->setEnergyLossCorrected(Adc[0]-Adc[1]-Adc[2], Adc[3],CalibArray);
669 newPointC->setFlag(100);
670 mPoint->addNewPoint(newPointC);
674 else if(!strcmp(currentKind,
"1p1n2p1n3p1n"))
676 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
677 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
678 newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2]-Adc[4],CalibArray);
679 newPointA->setFlag(100);
680 mPoint->addNewPoint(newPointA);
682 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
683 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
684 newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0]-Adc[4],CalibArray);
685 newPointB->setFlag(100);
686 mPoint->addNewPoint(newPointB);
688 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 31);
689 setMatcheds(dimensions, newPointC, currentPackage->getMatched(4), currentPackage->getMatched(1));
690 newPointC->setEnergyLossCorrected(Adc[4], Adc[1]-Adc[0]-Adc[2],CalibArray);
691 newPointC->setFlag(100);
692 mPoint->addNewPoint(newPointC);
696 else if(!strcmp(currentKind,
"1p1n2n2p2n"))
698 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 221);
699 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
700 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
701 newPointA->setFlag(100);
702 mPoint->addNewPoint(newPointA);
704 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 221);
705 setMatcheds(dimensions, newPointB, currentPackage->getMatched(3), currentPackage->getMatched(2));
706 newPointB->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
707 newPointB->setFlag(100);
708 mPoint->addNewPoint(newPointB);
712 else if(!strcmp(currentKind,
"1p1n2p1n2n"))
714 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 222);
715 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
716 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
717 newPointA->setFlag(100);
718 mPoint->addNewPoint(newPointA);
720 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 222);
721 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(4));
722 newPointB->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
723 newPointB->setFlag(100);
724 mPoint->addNewPoint(newPointB);
728 else if(!strcmp(currentKind,
"1p1n2n2p1n2n"))
730 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
731 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
732 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
734 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
735 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
736 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
738 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
739 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
740 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
742 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 223);
743 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
744 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
747 Double_t setA[2], setB[2], setC[2], setD[2];
748 Double_t probAD, probBC;
750 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
751 setA[1] = matchDistr(clusterControl, setA[0]);
752 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
753 setB[1] = matchDistr(clusterControl, setB[0]);
754 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
755 setC[1] = matchDistr(clusterControl, setC[0]);
756 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
757 setD[1] = matchDistr(clusterControl, setD[0]);
758 if ((setA[1]*setD[1])||(setB[1]*setC[1]))
760 Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
761 probAD = (setA[1]*setD[1])/tmp;
762 probBC = (setB[1]*setC[1])/tmp;
765 newPointA->setFlag(
int(100*probAD));
766 newPointD->setFlag(
int(100*probAD));
767 mPoint->addNewPoint(newPointA);
768 mPoint->addNewPoint(newPointD);
774 newPointB->setFlag(
int(100*probBC));
775 newPointC->setFlag(
int(100*probBC));
776 mPoint->addNewPoint(newPointB);
777 mPoint->addNewPoint(newPointC);
786 newPointA->setFlag(
int(100*probAD));
787 newPointB->setFlag(
int(100*probBC));
788 newPointC->setFlag(
int(100*probBC));
789 newPointD->setFlag(
int(100*probAD));
790 mPoint->addNewPoint(newPointA);
791 mPoint->addNewPoint(newPointD);
792 mPoint->addNewPoint(newPointB);
793 mPoint->addNewPoint(newPointC);
798 else if(!strcmp(currentKind,
"1p1n2n2p2n3n"))
800 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
801 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
802 newPointA->setFlag(100);
804 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
805 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
806 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
808 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
809 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
810 newPointC->setEnergyLossCorrected(Adc[3]-Adc[5], Adc[2],CalibArray);
812 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
813 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(5));
814 newPointD->setFlag(100);
817 Double_t setA[2], setD[2];
818 Double_t setAB[2], setCD[2];
819 Double_t probABD, probACD;
821 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
822 setA[1] = matchDistr(clusterControl, setA[0]);
823 setAB[0] = (Adc[0] - (Adc[1]+Adc[2]))/sqrt(2.0);
824 setAB[1] = matchDistr(clusterControl, setAB[0]);
825 setCD[0] = (Adc[3] - (Adc[2]+Adc[5]))/sqrt(2.0);
826 setCD[1] = matchDistr(clusterControl, setCD[0]);
827 setD[0] = (Adc[3] - Adc[5])/sqrt(2.0);
828 setD[1] = matchDistr(clusterControl, setD[0]);
829 Double_t tmp = 3e-33+(setAB[1]*setD[1]+setA[1]*setCD[1]+1e-10);
830 probABD = (setAB[1]*setD[1])/tmp;
831 probACD = (setA[1]*setCD[1])/tmp;
832 newPointB->setFlag(
int(100*probABD));
833 newPointC->setFlag(
int(100*probACD));
834 if (probABD > probACD)
836 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
837 newPointD->setEnergyLossCorrected(Adc[3], Adc[5],CalibArray);
838 mPoint->addNewPoint(newPointA);
839 mPoint->addNewPoint(newPointB);
840 mPoint->addNewPoint(newPointD);
845 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
846 newPointD->setEnergyLossCorrected(Adc[3]-Adc[2], Adc[5],CalibArray);
847 mPoint->addNewPoint(newPointA);
848 mPoint->addNewPoint(newPointB);
849 mPoint->addNewPoint(newPointC);
855 else if(!strcmp(currentKind,
"1p1n2p1n2n3p2n"))
857 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
858 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
859 newPointA->setFlag(100);
861 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
862 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
863 newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
865 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
866 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
867 newPointC->setEnergyLossCorrected(Adc[2], Adc[4]-Adc[5],CalibArray);
869 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
870 setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(4));
871 newPointD->setFlag(100);
874 Double_t setA[2], setD[2];
875 Double_t setAB[2], setCD[2];
876 Double_t probABD, probACD;
878 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
879 setA[1] = matchDistr(clusterControl, setA[0]);
880 setAB[0] = (Adc[0] + Adc[2] - Adc[1])/sqrt(2.0);
881 setAB[1] = matchDistr(clusterControl, setAB[0]);
882 setCD[0] = (Adc[2] + Adc[5] - Adc[4])/sqrt(2.0);
883 setCD[1] = matchDistr(clusterControl, setCD[0]);
884 setD[0] = (Adc[5] - Adc[4])/sqrt(2.0);
885 setD[1] = matchDistr(clusterControl, setD[0]);
886 Double_t tmp = 3e-33+(setAB[1]*setD[1]+setA[1]*setCD[1]);
887 probABD = (setAB[1]*setD[1])/tmp;
888 probACD = (setA[1]*setCD[1])/tmp;
889 newPointB->setFlag(
int(100*probABD));
890 newPointC->setFlag(
int(100*probACD));
891 if (probABD > probACD)
893 newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
894 newPointD->setEnergyLossCorrected(Adc[5], Adc[4],CalibArray);
895 mPoint->addNewPoint(newPointA);
896 mPoint->addNewPoint(newPointB);
897 mPoint->addNewPoint(newPointD);
902 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
903 newPointD->setEnergyLossCorrected(Adc[5], Adc[4]-Adc[2],CalibArray);
904 mPoint->addNewPoint(newPointA);
905 mPoint->addNewPoint(newPointB);
906 mPoint->addNewPoint(newPointC);
912 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n"))
914 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
915 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
916 newPointA->setFlag(100);
918 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
919 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
920 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
922 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
923 setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
924 newPointC->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[3],CalibArray);
926 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
927 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
929 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
930 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(3));
933 Double_t setA[2], setD[2], setE[2];
934 Double_t setAB[2], setAC[2], setDE[2];
935 Double_t probABE, probACD, probADE;
937 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
938 setA[1] = matchDistr(clusterControl, setA[0]);
939 setAB[0] = (Adc[0] - (Adc[1] + Adc[2]))/sqrt(2.0);
940 setAB[1] = matchDistr(clusterControl, setAB[0]);
941 setAC[0] = (Adc[0] - (Adc[1] + Adc[3]))/sqrt(2.0);
942 setAC[1] = matchDistr(clusterControl, setAC[0]);
943 setDE[0] = (Adc[4] - (Adc[2] + Adc[3]))/sqrt(2.0);
944 setDE[1] = matchDistr(clusterControl, setDE[0]);
945 setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
946 setD[1] = matchDistr(clusterControl, setD[0]);
947 setE[0] = (Adc[4] - Adc[3])/sqrt(2.0);
948 setE[1] = matchDistr(clusterControl, setE[0]);
949 Double_t tmp = 3e-33+(setAB[1]*setE[1]+setAC[1]*setD[1]+setA[1]*setDE[1]);
950 probABE = (setAB[1]*setE[1])/tmp;
951 probACD = (setAC[1]*setD[1])/tmp;
952 probADE = (setA[1]*setDE[1])/tmp;
953 newPointB->setFlag(
int(100*probABE));
954 newPointC->setFlag(
int(100*probACD));
955 newPointD->setFlag(
int(100*(probACD+probADE)));
956 newPointE->setFlag(
int(100*(probABE+probADE)));
957 if ((probABE > probACD)&&(probABE > probADE))
959 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
960 newPointE->setEnergyLossCorrected(Adc[4],Adc[3],CalibArray);
961 mPoint->addNewPoint(newPointA);
962 mPoint->addNewPoint(newPointB);
963 mPoint->addNewPoint(newPointE);
967 else if ((probACD > probABE)&&(probACD > probADE))
969 newPointA->setEnergyLossCorrected(Adc[0]-Adc[3],Adc[1],CalibArray);
970 newPointD->setEnergyLossCorrected(Adc[4],Adc[2],CalibArray);
971 mPoint->addNewPoint(newPointA);
972 mPoint->addNewPoint(newPointC);
973 mPoint->addNewPoint(newPointD);
977 else if ((probADE > probABE)&&(probADE > probACD))
979 newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
980 newPointD->setEnergyLossCorrected(Adc[4]-Adc[3],Adc[2],CalibArray);
981 newPointE->setEnergyLossCorrected(Adc[4]-Adc[2],Adc[3],CalibArray);
982 mPoint->addNewPoint(newPointA);
983 mPoint->addNewPoint(newPointB);
984 mPoint->addNewPoint(newPointE);
991 else if(!strcmp(currentKind,
"1p1n2p1n2n3p1n2n"))
993 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
994 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
995 newPointA->setFlag(100);
997 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
998 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
999 newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
1001 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1002 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1004 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1005 setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(1));
1006 newPointD->setEnergyLossCorrected(Adc[5], Adc[1]-Adc[0],CalibArray);
1008 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1009 setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(4));
1012 Double_t setA[2], setC[2], setE[2];
1013 Double_t setAB[2], setAD[2], setCE[2];
1014 Double_t probABE, probACD, probACE;
1016 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1017 setA[1] = matchDistr(clusterControl, setA[0]);
1018 setAB[0] = (Adc[0] + Adc[2] - Adc[1])/sqrt(2.0);
1019 setAB[1] = matchDistr(clusterControl, setAB[0]);
1020 setAD[0] = (Adc[0] + Adc[5] - Adc[1])/sqrt(2.0);
1021 setAD[1] = matchDistr(clusterControl, setAD[0]);
1022 setCE[0] = (Adc[2] + Adc[5] + Adc[4])/sqrt(2.0);
1023 setCE[1] = matchDistr(clusterControl, setCE[0]);
1024 setC[0] = (Adc[2] - Adc[4])/sqrt(2.0);
1025 setC[1] = matchDistr(clusterControl, setC[0]);
1026 setE[0] = (Adc[5] - Adc[4])/sqrt(2.0);
1027 setE[1] = matchDistr(clusterControl, setE[0]);
1028 Double_t tmp = 3e-33+(setAB[1]*setE[1]+setAD[1]*setC[1]+setA[1]*setCE[1]);
1029 probABE = (setAB[1]*setE[1])/tmp;
1030 probACD = (setAD[1]*setC[1])/tmp;
1031 probACE = (setA[1]*setCE[1])/tmp;
1032 newPointB->setFlag(
int(100*probABE));
1033 newPointC->setFlag(
int(100*(probACD+probACE)));
1034 newPointD->setFlag(
int(100*probACD));
1035 newPointE->setFlag(
int(100*(probABE+probACE)));
1036 if ((probABE > probACD)&&(probABE > probACE))
1038 newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[2],CalibArray);
1039 newPointE->setEnergyLossCorrected(Adc[5],Adc[4],CalibArray);
1040 mPoint->addNewPoint(newPointA);
1041 mPoint->addNewPoint(newPointB);
1042 mPoint->addNewPoint(newPointE);
1046 else if ((probACD > probABE)&&(probACD > probACE))
1048 newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[5],CalibArray);
1049 newPointC->setEnergyLossCorrected(Adc[2],Adc[4],CalibArray);
1050 mPoint->addNewPoint(newPointA);
1051 mPoint->addNewPoint(newPointC);
1052 mPoint->addNewPoint(newPointD);
1056 else if ((probACE > probABE)&&(probACE > probACD))
1058 newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1059 newPointC->setEnergyLossCorrected(Adc[2],Adc[4]-Adc[5],CalibArray);
1060 newPointE->setEnergyLossCorrected(Adc[5],Adc[4]-Adc[2],CalibArray);
1061 mPoint->addNewPoint(newPointA);
1062 mPoint->addNewPoint(newPointB);
1063 mPoint->addNewPoint(newPointE);
1070 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n"))
1072 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1073 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1075 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1076 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1078 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1079 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1080 newPointC->setEnergyLossCorrected(Adc[3]-Adc[6],Adc[1],CalibArray);
1082 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1083 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1084 newPointD->setEnergyLossCorrected(Adc[3]-Adc[6], Adc[2],CalibArray);
1086 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1087 setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
1088 newPointE->setFlag(100);
1091 Double_t setA[2], setB[2], setE[2];
1092 Double_t setAB[2], setCE[2], setDE[2];
1093 Double_t probABE, probADE, probBCE;
1095 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1096 setA[1] = matchDistr(clusterControl, setA[0]);
1097 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1098 setB[1] = matchDistr(clusterControl, setB[0]);
1099 setAB[0] = (Adc[0] - (Adc[1] + Adc[2]))/sqrt(2.0);
1100 setAB[1] = matchDistr(clusterControl, setAB[0]);
1101 setCE[0] = (Adc[3] - (Adc[1] - Adc[6]))/sqrt(2.0);
1102 setCE[1] = matchDistr(clusterControl, setCE[0]);
1103 setDE[0] = (Adc[3] - (Adc[2] + Adc[6]))/sqrt(2.0);
1104 setDE[1] = matchDistr(clusterControl, setDE[0]);
1105 setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
1106 setE[1] = matchDistr(clusterControl, setE[0]);
1107 Double_t tmp = 3e-33+(setAB[1]*setE[1]+setA[1]*setDE[1]+setB[1]*setCE[1]);
1108 probABE = (setAB[1]*setE[1])/tmp;
1109 probADE = (setA[1]*setDE[1])/tmp;
1110 probBCE = (setB[1]*setCE[1])/tmp;
1111 newPointA->setFlag(
int(100*(probABE+probADE)));
1112 newPointB->setFlag(
int(100*(probABE+probBCE)));
1113 newPointC->setFlag(
int(100*probBCE));
1114 newPointD->setFlag(
int(100*probADE));
1115 if ((probABE > probADE)&&(probABE > probBCE))
1117 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2],Adc[1],CalibArray);
1118 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1],Adc[2],CalibArray);
1119 newPointE->setEnergyLossCorrected(Adc[3],Adc[6],CalibArray);
1120 mPoint->addNewPoint(newPointA);
1121 mPoint->addNewPoint(newPointB);
1122 mPoint->addNewPoint(newPointE);
1126 if ((probADE > probABE)&&(probADE > probBCE))
1128 newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1129 newPointE->setEnergyLossCorrected(Adc[3]-Adc[2],Adc[6],CalibArray);
1130 mPoint->addNewPoint(newPointA);
1131 mPoint->addNewPoint(newPointD);
1132 mPoint->addNewPoint(newPointE);
1136 if ((probBCE > probABE)&&(probBCE > probADE))
1138 newPointB->setEnergyLossCorrected(Adc[0],Adc[2],CalibArray);
1139 newPointE->setEnergyLossCorrected(Adc[3]-Adc[1],Adc[6],CalibArray);
1140 mPoint->addNewPoint(newPointB);
1141 mPoint->addNewPoint(newPointC);
1142 mPoint->addNewPoint(newPointE);
1149 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p2n"))
1151 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1152 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1154 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1155 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1156 newPointB->setEnergyLossCorrected(Adc[0]-Adc[6], Adc[2],CalibArray);
1158 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1159 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1161 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1162 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1163 newPointD->setEnergyLossCorrected(Adc[3]-Adc[6], Adc[2],CalibArray);
1165 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1166 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(2));
1167 newPointE->setFlag(100);
1170 Double_t setA[2], setC[2], setE[2];
1171 Double_t setAC[2], setBE[2], setDE[2];
1172 Double_t probACE, probADE, probBCE;
1174 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1175 setA[1] = matchDistr(clusterControl, setA[0]);
1176 setAC[0] = (Adc[0] + Adc[3] - Adc[1])/sqrt(2.0);
1177 setAC[1] = matchDistr(clusterControl, setAC[0]);
1178 setBE[0] = (Adc[0] + Adc[6] - Adc[2])/sqrt(2.0);
1179 setBE[1] = matchDistr(clusterControl, setBE[0]);
1180 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1181 setC[1] = matchDistr(clusterControl, setC[0]);
1182 setDE[0] = (Adc[3] + Adc[6] - Adc[2])/sqrt(2.0);
1183 setDE[1] = matchDistr(clusterControl, setDE[0]);
1184 setE[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1185 setE[1] = matchDistr(clusterControl, setE[0]);
1186 Double_t tmp = 3e-33+(setAC[1]*setE[1]+setA[1]*setDE[1]+setBE[1]*setC[1]);
1187 probACE = (setAC[1]*setE[1])/tmp;
1188 probADE = (setA[1]*setDE[1])/tmp;
1189 probBCE = (setBE[1]*setC[1])/tmp;
1190 newPointA->setFlag(
int(100*(probACE+probADE)));
1191 newPointB->setFlag(
int(100*probBCE));
1192 newPointC->setFlag(
int(100*(probACE+probBCE)));
1193 newPointD->setFlag(
int(100*probADE));
1194 if ((probACE > probADE)&&(probACE > probBCE))
1196 newPointA->setEnergyLossCorrected(Adc[0],Adc[1]-Adc[3],CalibArray);
1197 newPointC->setEnergyLossCorrected(Adc[3],Adc[1]-Adc[0],CalibArray);
1198 newPointE->setEnergyLossCorrected(Adc[6],Adc[2],CalibArray);
1199 mPoint->addNewPoint(newPointA);
1200 mPoint->addNewPoint(newPointC);
1201 mPoint->addNewPoint(newPointE);
1205 else if ((probADE > probACE)&&(probADE > probBCE))
1207 newPointA->setEnergyLossCorrected(Adc[0],Adc[1],CalibArray);
1208 newPointE->setEnergyLossCorrected(Adc[6],Adc[2]-Adc[3],CalibArray);
1209 mPoint->addNewPoint(newPointA);
1210 mPoint->addNewPoint(newPointD);
1211 mPoint->addNewPoint(newPointE);
1215 else if ((probBCE > probACE)&&(probBCE > probADE))
1217 newPointB->setEnergyLossCorrected(Adc[3],Adc[1],CalibArray);
1218 newPointE->setEnergyLossCorrected(Adc[6],Adc[2]-Adc[0],CalibArray);
1219 mPoint->addNewPoint(newPointB);
1220 mPoint->addNewPoint(newPointC);
1221 mPoint->addNewPoint(newPointE);
1228 else if(!strcmp(currentKind,
"1p1n2p1n2n3n"))
1230 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1231 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1232 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1233 newPointA->setFlag(100);
1234 mPoint->addNewPoint(newPointA);
1236 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1237 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1238 newPointC->setEnergyLossCorrected(Adc[2]-Adc[5], Adc[4],CalibArray);
1239 newPointC->setFlag(100);
1240 mPoint->addNewPoint(newPointC);
1242 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1243 setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1244 newPointD->setEnergyLossCorrected(Adc[2]-Adc[4], Adc[5],CalibArray);
1245 newPointD->setFlag(100);
1246 mPoint->addNewPoint(newPointD);
1251 else if(!strcmp(currentKind,
"1p1n2n2p2n3p2n"))
1253 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1254 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1255 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1256 newPointA->setFlag(100);
1257 mPoint->addNewPoint(newPointA);
1259 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1260 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1261 newPointC->setEnergyLossCorrected(Adc[3], Adc[2]-Adc[5],CalibArray);
1262 newPointC->setFlag(100);
1263 mPoint->addNewPoint(newPointC);
1265 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1266 setMatcheds(dimensions, newPointD, currentPackage->getMatched(5), currentPackage->getMatched(2));
1267 newPointD->setEnergyLossCorrected(Adc[5], Adc[2]-Adc[3],CalibArray);
1268 newPointD->setFlag(100);
1269 mPoint->addNewPoint(newPointD);
1274 else if(!strcmp(currentKind,
"1p1n2n3n2p3n"))
1276 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1277 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1278 newPointA->setEnergyLossCorrected(Adc[0]-Adc[2], Adc[1],CalibArray);
1279 newPointA->setFlag(100);
1280 mPoint->addNewPoint(newPointA);
1282 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1283 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1284 newPointB->setEnergyLossCorrected(Adc[0]-Adc[1], Adc[2],CalibArray);
1285 newPointB->setFlag(100);
1286 mPoint->addNewPoint(newPointB);
1288 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1289 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(5));
1290 newPointD->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
1291 newPointD->setFlag(100);
1292 mPoint->addNewPoint(newPointD);
1297 else if(!strcmp(currentKind,
"1p1n2p1n3p1n2n"))
1299 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1300 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1301 newPointA->setEnergyLossCorrected(Adc[0], Adc[1]-Adc[2],CalibArray);
1302 newPointA->setFlag(100);
1303 mPoint->addNewPoint(newPointA);
1305 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1306 setMatcheds(dimensions, newPointB, currentPackage->getMatched(2), currentPackage->getMatched(1));
1307 newPointB->setEnergyLossCorrected(Adc[2], Adc[1]-Adc[0],CalibArray);
1308 newPointB->setFlag(100);
1309 mPoint->addNewPoint(newPointB);
1311 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 32);
1312 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(6));
1313 newPointD->setEnergyLossCorrected(Adc[4], Adc[6],CalibArray);
1314 newPointD->setFlag(100);
1315 mPoint->addNewPoint(newPointD);
1320 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n"))
1322 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1323 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1325 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1326 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1328 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1329 setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
1331 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1332 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
1334 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1335 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
1337 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1338 setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
1341 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2];
1342 Double_t setAB[2], setAC[2], setBC[2], setDE[2], setDF[2], setEF[2];
1345 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1346 setA[1] = matchDistr(clusterControl, setA[0]);
1347 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1348 setB[1] = matchDistr(clusterControl, setB[0]);
1349 setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
1350 setC[1] = matchDistr(clusterControl, setC[0]);
1351 setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
1352 setD[1] = matchDistr(clusterControl, setD[0]);
1353 setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
1354 setE[1] = matchDistr(clusterControl, setE[0]);
1355 setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
1356 setF[1] = matchDistr(clusterControl, setF[0]);
1357 setAB[0] = (Adc[0] - Adc[1] - Adc[2])/sqrt(2.0);
1358 setAB[1] = matchDistr(clusterControl, setAB[0]);
1359 setAC[0] = (Adc[0] - Adc[1] - Adc[3])/sqrt(2.0);
1360 setAC[1] = matchDistr(clusterControl, setAC[0]);
1361 setBC[0] = (Adc[0] - Adc[2] - Adc[3])/sqrt(2.0);
1362 setBC[1] = matchDistr(clusterControl, setBC[0]);
1363 setDE[0] = (Adc[4] - Adc[1] - Adc[2])/sqrt(2.0);
1364 setDE[1] = matchDistr(clusterControl, setDE[0]);
1365 setDF[0] = (Adc[4] - Adc[1] - Adc[3])/sqrt(2.0);
1366 setDF[1] = matchDistr(clusterControl, setDF[0]);
1367 setEF[0] = (Adc[4] - Adc[2] - Adc[3])/sqrt(2.0);
1368 setEF[1] = matchDistr(clusterControl, setEF[0]);
1369 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]);
1370 prob[0] = (setAC[1]*setE[1]+setAB[1]*setF[1]+setEF[1]*setA[1])/tmp;
1371 prob[1] = (setAB[1]*setF[1]+setBC[1]*setD[1]+setDF[1]*setB[1])/tmp;
1372 prob[2] = (setAC[1]*setE[1]+setBC[1]*setD[1]+setDE[1]*setC[1])/tmp;
1373 prob[3] = (setBC[1]*setD[1]+setDF[1]*setB[1]+setDE[1]*setC[1])/tmp;
1374 prob[4] = (setAC[1]*setE[1]+setDE[1]*setC[1]+setEF[1]*setA[1])/tmp;
1375 prob[5] = (setAB[1]*setF[1]+setDF[1]*setB[1]+setEF[1]*setA[1])/tmp;
1376 newPointA->setFlag(
int(100*prob[0]));
1377 newPointB->setFlag(
int(100*prob[1]));
1378 newPointC->setFlag(
int(100*prob[2]));
1379 newPointD->setFlag(
int(100*prob[3]));
1380 newPointE->setFlag(
int(100*prob[4]));
1381 newPointF->setFlag(
int(100*prob[5]));
1382 mPoint->addNewPoint(newPointA);
1383 mPoint->addNewPoint(newPointB);
1384 mPoint->addNewPoint(newPointC);
1385 mPoint->addNewPoint(newPointD);
1386 mPoint->addNewPoint(newPointE);
1387 mPoint->addNewPoint(newPointF);
1391 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p1n2n"))
1393 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1394 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1396 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1397 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1399 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1400 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1402 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1403 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1405 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1406 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(1));
1408 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 23);
1409 setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(2));
1412 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2];
1413 Double_t setAC[2], setBD[2], setAE[2], setBF[2], setCE[2], setDF[2];
1416 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1417 setA[1] = matchDistr(clusterControl, setA[0]);
1418 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1419 setB[1] = matchDistr(clusterControl, setB[0]);
1420 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1421 setC[1] = matchDistr(clusterControl, setC[0]);
1422 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1423 setD[1] = matchDistr(clusterControl, setD[0]);
1424 setE[0] = (Adc[6] - Adc[1])/sqrt(2.0);
1425 setE[1] = matchDistr(clusterControl, setE[0]);
1426 setF[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1427 setF[1] = matchDistr(clusterControl, setF[0]);
1428 setAC[0] = (Adc[0] + Adc[3] - Adc[1])/sqrt(2.0);
1429 setAC[1] = matchDistr(clusterControl, setAC[0]);
1430 setBD[0] = (Adc[0] + Adc[3] - Adc[2])/sqrt(2.0);
1431 setBD[1] = matchDistr(clusterControl, setBD[0]);
1432 setAE[0] = (Adc[0] + Adc[6] - Adc[1])/sqrt(2.0);
1433 setAE[1] = matchDistr(clusterControl, setAE[0]);
1434 setBF[0] = (Adc[0] + Adc[6] - Adc[2])/sqrt(2.0);
1435 setBF[1] = matchDistr(clusterControl, setBF[0]);
1436 setCE[0] = (Adc[3] + Adc[6] - Adc[1])/sqrt(2.0);
1437 setCE[1] = matchDistr(clusterControl, setCE[0]);
1438 setDF[0] = (Adc[3] + Adc[6] - Adc[2])/sqrt(2.0);
1439 setDF[1] = matchDistr(clusterControl, setDF[0]);
1440 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]);
1441 prob[0] = (setAC[1]*setF[1]+setAE[1]*setD[1]+setDF[1]*setA[1])/tmp;
1442 prob[1] = (setCE[1]*setB[1]+setBD[1]*setE[1]+setBF[1]*setC[1])/tmp;
1443 prob[2] = (setAC[1]*setF[1]+setCE[1]*setB[1]+setBF[1]*setC[1])/tmp;
1444 prob[3] = (setAE[1]*setD[1]+setCE[1]*setB[1]+setBD[1]*setE[1])/tmp;
1445 prob[4] = (setAE[1]*setD[1]+setDF[1]*setA[1]+setBD[1]*setE[1])/tmp;
1446 prob[5] = (setAC[1]*setF[1]+setDF[1]*setA[1]+setBF[1]*setC[1])/tmp;
1447 newPointA->setFlag(
int(100*prob[0]));
1448 newPointB->setFlag(
int(100*prob[1]));
1449 newPointC->setFlag(
int(100*prob[2]));
1450 newPointD->setFlag(
int(100*prob[3]));
1451 newPointE->setFlag(
int(100*prob[4]));
1452 newPointF->setFlag(
int(100*prob[5]));
1453 mPoint->addNewPoint(newPointA);
1454 mPoint->addNewPoint(newPointB);
1455 mPoint->addNewPoint(newPointC);
1456 mPoint->addNewPoint(newPointD);
1457 mPoint->addNewPoint(newPointE);
1458 mPoint->addNewPoint(newPointF);
1462 else if(!strcmp(currentKind,
"1p1n2n2p2n3n3p3n"))
1464 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1465 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1466 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1467 newPointA->setFlag(100);
1468 mPoint->addNewPoint(newPointA);
1470 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1471 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1472 newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1473 newPointC->setFlag(100);
1474 mPoint->addNewPoint(newPointC);
1476 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1477 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(5));
1478 newPointE->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1479 newPointE->setFlag(100);
1480 mPoint->addNewPoint(newPointE);
1485 else if(!strcmp(currentKind,
"1p1n2p1n2n3p2n3n"))
1487 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1488 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1489 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1490 newPointA->setFlag(100);
1491 mPoint->addNewPoint(newPointA);
1493 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1494 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1495 newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1496 newPointC->setFlag(100);
1497 mPoint->addNewPoint(newPointC);
1499 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1500 setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(7));
1501 newPointE->setEnergyLossCorrected(Adc[5], Adc[7],CalibArray);
1502 newPointE->setFlag(100);
1503 mPoint->addNewPoint(newPointE);
1508 else if(!strcmp(currentKind,
"1p1n2n2p2n3n3p2n3n"))
1510 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1511 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1512 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1513 newPointA->setFlag(100);
1515 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1516 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
1517 newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1519 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1520 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(5));
1521 newPointD->setEnergyLossCorrected(Adc[3], Adc[5],CalibArray);
1523 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1524 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(2));
1525 newPointE->setEnergyLossCorrected(Adc[6], Adc[2],CalibArray);
1527 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1528 setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(5));
1529 newPointF->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1532 Double_t setC[2], setD[2], setE[2], setF[2];
1533 Double_t probACF, probADE;
1535 setC[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1536 setC[1] = matchDistr(clusterControl, setC[0]);
1537 setD[0] = (Adc[3] - Adc[5])/sqrt(2.0);
1538 setD[1] = matchDistr(clusterControl, setD[0]);
1539 setE[0] = (Adc[6] - Adc[2])/sqrt(2.0);
1540 setE[1] = matchDistr(clusterControl, setE[0]);
1541 setF[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1542 setF[1] = matchDistr(clusterControl, setF[0]);
1543 Double_t tmp = 3e-33+ setC[1]*setF[1]+setD[1]*setE[1];
1544 probACF = (setC[1]*setF[1])/tmp;
1545 probADE = (setD[1]*setE[1])/tmp;
1546 newPointC->setFlag(
int(100*probACF));
1547 newPointD->setFlag(
int(100*probADE));
1548 newPointE->setFlag(
int(100*probADE));
1549 newPointF->setFlag(
int(100*probACF));
1553 mPoint->addNewPoint(newPointA);
1554 mPoint->addNewPoint(newPointC);
1555 mPoint->addNewPoint(newPointF);
1561 mPoint->addNewPoint(newPointA);
1562 mPoint->addNewPoint(newPointD);
1563 mPoint->addNewPoint(newPointE);
1570 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p2n3n"))
1572 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1573 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1574 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1575 newPointA->setFlag(100);
1577 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1578 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1579 newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1581 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1582 setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1583 newPointD->setEnergyLossCorrected(Adc[2], Adc[5],CalibArray);
1585 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1586 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(4));
1587 newPointE->setEnergyLossCorrected(Adc[6], Adc[4],CalibArray);
1589 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1590 setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(5));
1591 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[2] - Adc[4])/sqrt(2.0);
1598 setC[1] = matchDistr(clusterControl, setC[0]);
1599 setD[0] = (Adc[2] - Adc[5])/sqrt(2.0);
1600 setD[1] = matchDistr(clusterControl, setD[0]);
1601 setE[0] = (Adc[6] - Adc[4])/sqrt(2.0);
1602 setE[1] = matchDistr(clusterControl, setE[0]);
1603 setF[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1604 setF[1] = matchDistr(clusterControl, setF[0]);
1605 Double_t tmp = 3e-33+ setC[1]*setF[1]+setD[1]*setE[1];
1606 probACF = (setC[1]*setF[1])/tmp;
1607 probADE = (setD[1]*setE[1])/tmp;
1608 newPointC->setFlag(
int(100*probACF));
1609 newPointD->setFlag(
int(100*probADE));
1610 newPointE->setFlag(
int(100*probADE));
1611 newPointF->setFlag(
int(100*probACF));
1614 mPoint->addNewPoint(newPointA);
1615 mPoint->addNewPoint(newPointC);
1616 mPoint->addNewPoint(newPointF);
1622 mPoint->addNewPoint(newPointA);
1623 mPoint->addNewPoint(newPointD);
1624 mPoint->addNewPoint(newPointE);
1631 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p2n3n"))
1633 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1634 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1635 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1637 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1638 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1639 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1641 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1642 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1643 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
1645 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1646 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1647 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1649 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1650 setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(8));
1651 newPointF->setEnergyLossCorrected(Adc[6], Adc[8],CalibArray);
1652 newPointF->setFlag(100);
1655 Double_t setA[2], setB[2], setC[2], setD[2];
1656 Double_t probADF, probBCF;
1658 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1659 setA[1] = matchDistr(clusterControl, setA[0]);
1660 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1661 setB[1] = matchDistr(clusterControl, setB[0]);
1662 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1663 setC[1] = matchDistr(clusterControl, setC[0]);
1664 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1665 setD[1] = matchDistr(clusterControl, setD[0]);
1666 Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
1667 probADF = (setA[1]*setD[1])/tmp;
1668 probBCF = (setB[1]*setC[1])/tmp;
1669 newPointA->setFlag(
int(100*probADF));
1670 newPointB->setFlag(
int(100*probBCF));
1671 newPointC->setFlag(
int(100*probBCF));
1672 newPointD->setFlag(
int(100*probADF));
1675 mPoint->addNewPoint(newPointA);
1676 mPoint->addNewPoint(newPointD);
1677 mPoint->addNewPoint(newPointF);
1683 mPoint->addNewPoint(newPointB);
1684 mPoint->addNewPoint(newPointC);
1685 mPoint->addNewPoint(newPointF);
1692 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p3n"))
1694 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1695 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1696 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1698 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1699 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1700 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1702 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1703 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1704 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
1706 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1707 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1708 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1710 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1711 setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(6));
1712 newPointF->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
1713 newPointF->setNMatched(33);
1714 newPointF->setFlag(100);
1717 Double_t setA[2], setB[2], setC[2], setD[2];
1718 Double_t probADF, probBCF;
1720 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1721 setA[1] = matchDistr(clusterControl, setA[0]);
1722 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1723 setB[1] = matchDistr(clusterControl, setB[0]);
1724 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1725 setC[1] = matchDistr(clusterControl, setC[0]);
1726 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1727 setD[1] = matchDistr(clusterControl, setD[0]);
1728 Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
1729 probADF = (setA[1]*setD[1])/tmp;
1730 probBCF = (setB[1]*setC[1])/tmp;
1731 newPointA->setFlag(
int(100*probADF));
1732 newPointB->setFlag(
int(100*probBCF));
1733 newPointC->setFlag(
int(100*probBCF));
1734 newPointD->setFlag(
int(100*probADF));
1737 mPoint->addNewPoint(newPointA);
1738 mPoint->addNewPoint(newPointD);
1739 mPoint->addNewPoint(newPointF);
1745 mPoint->addNewPoint(newPointB);
1746 mPoint->addNewPoint(newPointC);
1747 mPoint->addNewPoint(newPointF);
1754 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n3p3n"))
1756 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1757 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1758 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1759 newPointA->setFlag(100);
1760 mPoint->addNewPoint(newPointA);
1762 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1763 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
1764 newPointD->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
1765 newPointD->setFlag(100);
1766 mPoint->addNewPoint(newPointD);
1768 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1769 setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(3));
1770 newPointF->setEnergyLossCorrected(Adc[7], Adc[3],CalibArray);
1771 newPointF->setFlag(100);
1772 mPoint->addNewPoint(newPointF);
1778 else if(!strcmp(currentKind,
"1p1n2p1n2n3p1n2n3n"))
1780 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1781 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1782 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1783 newPointA->setFlag(100);
1784 mPoint->addNewPoint(newPointA);
1786 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1787 setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(4));
1788 newPointD->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1789 newPointD->setFlag(100);
1790 mPoint->addNewPoint(newPointD);
1792 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1793 setMatcheds(dimensions, newPointF, currentPackage->getMatched(5), currentPackage->getMatched(8));
1794 newPointF->setEnergyLossCorrected(Adc[5], Adc[8],CalibArray);
1795 newPointF->setFlag(100);
1796 mPoint->addNewPoint(newPointF);
1802 else if(!strcmp(currentKind,
"1p1n2n3n2p2n3n3p2n3n"))
1804 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1805 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1806 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1807 newPointA->setFlag(100);
1809 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1810 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(2));
1811 newPointD->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
1813 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1814 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(3));
1815 newPointE->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
1817 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1818 setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(2));
1819 newPointF->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
1821 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1822 setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(3));
1823 newPointG->setEnergyLossCorrected(Adc[7], Adc[3],CalibArray);
1826 Double_t setD[2], setE[2], setF[2], setG[2];
1827 Double_t probADG, probAEF;
1829 setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
1830 setD[1] = matchDistr(clusterControl, setD[0]);
1831 setE[0] = (Adc[4] - Adc[3])/sqrt(2.0);
1832 setE[1] = matchDistr(clusterControl, setE[0]);
1833 setF[0] = (Adc[7] - Adc[2])/sqrt(2.0);
1834 setF[1] = matchDistr(clusterControl, setF[0]);
1835 setG[0] = (Adc[7] - Adc[3])/sqrt(2.0);
1836 setG[1] = matchDistr(clusterControl, setG[0]);
1837 Double_t tmp = 3e-33+(setD[1]*setG[1]+setE[1]*setF[1]);
1838 probADG = (setD[1]*setG[1])/tmp;
1839 probAEF = (setE[1]*setF[1])/tmp;
1840 newPointD->setFlag(
int(100*probADG));
1841 newPointE->setFlag(
int(100*probAEF));
1842 newPointF->setFlag(
int(100*probAEF));
1843 newPointG->setFlag(
int(100*probADG));
1846 mPoint->addNewPoint(newPointA);
1847 mPoint->addNewPoint(newPointD);
1848 mPoint->addNewPoint(newPointG);
1854 mPoint->addNewPoint(newPointA);
1855 mPoint->addNewPoint(newPointE);
1856 mPoint->addNewPoint(newPointF);
1863 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p1n2n3n"))
1865 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1866 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1867 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1868 newPointA->setFlag(100);
1870 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1871 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
1872 newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
1874 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1875 setMatcheds(dimensions, newPointD, currentPackage->getMatched(2), currentPackage->getMatched(5));
1876 newPointD->setEnergyLossCorrected(Adc[2], Adc[5],CalibArray);
1878 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1879 setMatcheds(dimensions, newPointF, currentPackage->getMatched(6), currentPackage->getMatched(4));
1880 newPointF->setEnergyLossCorrected(Adc[6], Adc[4],CalibArray);
1882 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1883 setMatcheds(dimensions, newPointG, currentPackage->getMatched(6), currentPackage->getMatched(5));
1884 newPointG->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
1887 Double_t setC[2], setD[2], setF[2], setG[2];
1888 Double_t probACG, probADF;
1890 setC[0] = (Adc[2] - Adc[4])/sqrt(2.0);
1891 setC[1] = matchDistr(clusterControl, setC[0]);
1892 setD[0] = (Adc[2] - Adc[5])/sqrt(2.0);
1893 setD[1] = matchDistr(clusterControl, setD[0]);
1894 setF[0] = (Adc[6] - Adc[4])/sqrt(2.0);
1895 setF[1] = matchDistr(clusterControl, setF[0]);
1896 setG[0] = (Adc[6] - Adc[5])/sqrt(2.0);
1897 setG[1] = matchDistr(clusterControl, setG[0]);
1898 Double_t tmp = 3e-33+(setC[1]*setG[1]+setD[1]*setF[1]);
1899 probACG = (setC[1]*setG[1])/tmp;
1900 probADF = (setD[1]*setF[1])/tmp;
1901 newPointC->setFlag(
int(100*probACG));
1902 newPointD->setFlag(
int(100*probADF));
1903 newPointF->setFlag(
int(100*probADF));
1904 newPointG->setFlag(
int(100*probACG));
1907 mPoint->addNewPoint(newPointA);
1908 mPoint->addNewPoint(newPointC);
1909 mPoint->addNewPoint(newPointG);
1915 mPoint->addNewPoint(newPointA);
1916 mPoint->addNewPoint(newPointD);
1917 mPoint->addNewPoint(newPointF);
1924 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3p1n2n3n"))
1926 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1927 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1928 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1930 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1931 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1932 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1934 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1935 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
1936 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
1938 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1939 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
1940 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
1942 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1943 setMatcheds(dimensions, newPointG, currentPackage->getMatched(6), currentPackage->getMatched(9));
1944 newPointG->setEnergyLossCorrected(Adc[6], Adc[9],CalibArray);
1945 newPointG->setFlag(100);
1948 Double_t setA[2], setB[2], setC[2], setD[2];
1949 Double_t probADG, probBCG;
1951 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
1952 setA[1] = matchDistr(clusterControl, setA[0]);
1953 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
1954 setB[1] = matchDistr(clusterControl, setB[0]);
1955 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
1956 setC[1] = matchDistr(clusterControl, setC[0]);
1957 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
1958 setD[1] = matchDistr(clusterControl, setD[0]);
1959 Double_t tmp = 3e-33+(setA[1]*setD[1]+setB[1]*setC[1]);
1960 probADG = (setA[1]*setD[1])/tmp;
1961 probBCG = (setB[1]*setC[1])/tmp;
1962 newPointA->setFlag(
int(100*probADG));
1963 newPointB->setFlag(
int(100*probBCG));
1964 newPointC->setFlag(
int(100*probBCG));
1965 newPointD->setFlag(
int(100*probADG));
1968 mPoint->addNewPoint(newPointA);
1969 mPoint->addNewPoint(newPointD);
1970 mPoint->addNewPoint(newPointG);
1976 mPoint->addNewPoint(newPointB);
1977 mPoint->addNewPoint(newPointC);
1978 mPoint->addNewPoint(newPointG);
1985 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p3n"))
1987 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1988 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
1989 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
1991 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1992 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
1993 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
1995 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
1996 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
1997 newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
1999 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2000 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2001 newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2003 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2004 setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(3));
2005 newPointG->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2006 newPointG->setFlag(100);
2009 Double_t setA[2], setB[2], setD[2], setE[2];
2010 Double_t probAEG, probBDG;
2012 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2013 setA[1] = matchDistr(clusterControl, setA[0]);
2014 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2015 setB[1] = matchDistr(clusterControl, setB[0]);
2016 setD[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2017 setD[1] = matchDistr(clusterControl, setD[0]);
2018 setE[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2019 setE[1] = matchDistr(clusterControl, setE[0]);
2020 Double_t tmp = 3e-33+(setA[1]*setE[1]+setB[1]*setD[1]);
2021 probAEG = (setA[1]*setE[1])/tmp;
2022 probBDG = (setB[1]*setD[1])/tmp;
2023 newPointA->setFlag(
int(100*probAEG));
2024 newPointB->setFlag(
int(100*probBDG));
2025 newPointD->setFlag(
int(100*probBDG));
2026 newPointE->setFlag(
int(100*probAEG));
2030 mPoint->addNewPoint(newPointA);
2031 mPoint->addNewPoint(newPointE);
2032 mPoint->addNewPoint(newPointG);
2038 mPoint->addNewPoint(newPointB);
2039 mPoint->addNewPoint(newPointD);
2040 mPoint->addNewPoint(newPointG);
2047 else if(!strcmp(currentKind,
"1p1n2p1n2n3n3p3n"))
2049 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2050 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2051 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2052 newPointA->setFlag(100);
2053 mPoint->addNewPoint(newPointA);
2055 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2056 setMatcheds(dimensions, newPointC, currentPackage->getMatched(2), currentPackage->getMatched(4));
2057 newPointC->setEnergyLossCorrected(Adc[2], Adc[4],CalibArray);
2058 newPointC->setFlag(100);
2059 mPoint->addNewPoint(newPointC);
2061 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2062 setMatcheds(dimensions, newPointE, currentPackage->getMatched(6), currentPackage->getMatched(5));
2063 newPointE->setEnergyLossCorrected(Adc[6], Adc[5],CalibArray);
2064 newPointE->setFlag(100);
2065 mPoint->addNewPoint(newPointE);
2070 else if(!strcmp(currentKind,
"1p1n2n2p2n3p2n3n"))
2072 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2073 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2074 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2075 newPointA->setFlag(100);
2076 mPoint->addNewPoint(newPointA);
2078 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2079 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(2));
2080 newPointC->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2081 newPointC->setFlag(100);
2082 mPoint->addNewPoint(newPointC);
2084 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2085 setMatcheds(dimensions, newPointE, currentPackage->getMatched(5), currentPackage->getMatched(7));
2086 newPointE->setEnergyLossCorrected(Adc[5], Adc[7],CalibArray);
2087 newPointE->setFlag(100);
2088 mPoint->addNewPoint(newPointE);
2093 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p2n3n"))
2095 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2096 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2097 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2099 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2100 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2101 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2103 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2104 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
2105 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
2107 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2108 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
2109 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2111 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2112 setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
2113 newPointE->setEnergyLossCorrected(Adc[3], Adc[6],CalibArray);
2115 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2116 setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(2));
2117 newPointF->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
2119 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2120 setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(6));
2121 newPointG->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
2124 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2];
2125 Double_t probADG, probAEF, probBCG;
2127 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2128 setA[1] = matchDistr(clusterControl, setA[0]);
2129 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2130 setB[1] = matchDistr(clusterControl, setB[0]);
2131 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
2132 setC[1] = matchDistr(clusterControl, setC[0]);
2133 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
2134 setD[1] = matchDistr(clusterControl, setD[0]);
2135 setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
2136 setE[1] = matchDistr(clusterControl, setE[0]);
2137 setF[0] = (Adc[7] - Adc[2])/sqrt(2.0);
2138 setF[1] = matchDistr(clusterControl, setF[0]);
2139 setG[0] = (Adc[7] - Adc[6])/sqrt(2.0);
2140 setG[1] = matchDistr(clusterControl, setG[0]);
2141 Double_t tmp = 3e-33+(setA[1]*setD[1]*setG[1]+setA[1]*setE[1]*setF[1]+setB[1]*setC[1]*setG[1]);
2142 probADG = (setA[1]*setD[1]*setG[1])/tmp;
2143 probAEF = (setA[1]*setE[1]*setF[1])/tmp;
2144 probBCG = (setB[1]*setC[1]*setG[1])/tmp;
2145 newPointA->setFlag(
int(100*(probADG+probAEF)));
2146 newPointB->setFlag(
int(100*probBCG));
2147 newPointC->setFlag(
int(100*probBCG));
2148 newPointD->setFlag(
int(100*probADG));
2149 newPointE->setFlag(
int(100*probAEF));
2150 newPointF->setFlag(
int(100*probAEF));
2151 newPointG->setFlag(
int(100*(probADG+probBCG)));
2153 if ((probADG > probAEF)&&(probADG > probBCG))
2156 mPoint->addNewPoint(newPointA);
2157 mPoint->addNewPoint(newPointD);
2158 mPoint->addNewPoint(newPointG);
2164 else if ((probAEF > probADG)&&(probAEF > probBCG))
2166 mPoint->addNewPoint(newPointA);
2167 mPoint->addNewPoint(newPointE);
2168 mPoint->addNewPoint(newPointF);
2174 else if ((probBCG > probADG)&&(probBCG > probAEF))
2176 mPoint->addNewPoint(newPointB);
2177 mPoint->addNewPoint(newPointC);
2178 mPoint->addNewPoint(newPointG);
2187 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p2n3n"))
2189 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2190 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2191 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2193 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2194 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2195 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2197 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2198 setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
2199 newPointC->setEnergyLossCorrected(Adc[0], Adc[3],CalibArray);
2201 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2202 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
2203 newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
2205 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2206 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2207 newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2209 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2210 setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
2211 newPointF->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
2213 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2214 setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(2));
2215 newPointG->setEnergyLossCorrected(Adc[8], Adc[2],CalibArray);
2217 StSstPoint *newPointH =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2218 setMatcheds(dimensions, newPointH, currentPackage->getMatched(8), currentPackage->getMatched(3));
2219 newPointH->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2222 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2];
2223 Double_t probAEH, probAFG, probBDH, probCDG;
2225 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2226 setA[1] = matchDistr(clusterControl, setA[0]);
2227 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2228 setB[1] = matchDistr(clusterControl, setB[0]);
2229 setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
2230 setC[1] = matchDistr(clusterControl, setC[0]);
2231 setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2232 setD[1] = matchDistr(clusterControl, setD[0]);
2233 setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2234 setE[1] = matchDistr(clusterControl, setE[0]);
2235 setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
2236 setF[1] = matchDistr(clusterControl, setF[0]);
2237 setG[0] = (Adc[8] - Adc[2])/sqrt(2.0);
2238 setG[1] = matchDistr(clusterControl, setG[0]);
2239 setH[0] = (Adc[8] - Adc[3])/sqrt(2.0);
2240 setH[1] = matchDistr(clusterControl, setH[0]);
2241 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]);
2242 probAEH = (setA[1]*setE[1]*setH[1])/tmp;
2243 probAFG = (setA[1]*setF[1]*setG[1])/tmp;
2244 probBDH = (setB[1]*setD[1]*setH[1])/tmp;
2245 probCDG = (setC[1]*setD[1]*setG[1])/tmp;
2246 newPointA->setFlag(
int(100*(probAEH+probAFG)));
2247 newPointB->setFlag(
int(100*probBDH));
2248 newPointC->setFlag(
int(100*probCDG));
2249 newPointD->setFlag(
int(100*(probBDH+probCDG)));
2250 newPointE->setFlag(
int(100*probAEH));
2251 newPointF->setFlag(
int(100*probAFG));
2252 newPointG->setFlag(
int(100*(probAFG+probCDG)));
2253 newPointH->setFlag(
int(100*(probAEH+probBDH)));
2254 mPoint->addNewPoint(newPointA);
2255 mPoint->addNewPoint(newPointB);
2256 mPoint->addNewPoint(newPointC);
2257 mPoint->addNewPoint(newPointD);
2258 mPoint->addNewPoint(newPointE);
2259 mPoint->addNewPoint(newPointF);
2260 mPoint->addNewPoint(newPointG);
2261 mPoint->addNewPoint(newPointH);
2265 else if(!strcmp(currentKind,
"1p1n2n2p1n2n3n3p1n2n3n"))
2267 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2268 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2269 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2271 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2272 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2273 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2275 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2276 setMatcheds(dimensions, newPointC, currentPackage->getMatched(3), currentPackage->getMatched(1));
2277 newPointC->setEnergyLossCorrected(Adc[3], Adc[1],CalibArray);
2279 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2280 setMatcheds(dimensions, newPointD, currentPackage->getMatched(3), currentPackage->getMatched(2));
2281 newPointD->setEnergyLossCorrected(Adc[3], Adc[2],CalibArray);
2283 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2284 setMatcheds(dimensions, newPointE, currentPackage->getMatched(3), currentPackage->getMatched(6));
2285 newPointE->setEnergyLossCorrected(Adc[3], Adc[6],CalibArray);
2287 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2288 setMatcheds(dimensions, newPointF, currentPackage->getMatched(7), currentPackage->getMatched(1));
2289 newPointF->setEnergyLossCorrected(Adc[7], Adc[1],CalibArray);
2291 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2292 setMatcheds(dimensions, newPointG, currentPackage->getMatched(7), currentPackage->getMatched(2));
2293 newPointG->setEnergyLossCorrected(Adc[7], Adc[2],CalibArray);
2295 StSstPoint *newPointH =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2296 setMatcheds(dimensions, newPointH, currentPackage->getMatched(7), currentPackage->getMatched(6));
2297 newPointH->setEnergyLossCorrected(Adc[7], Adc[6],CalibArray);
2300 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2];
2301 Double_t probADH, probAEG, probBCH, probBEF;
2303 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2304 setA[1] = matchDistr(clusterControl, setA[0]);
2305 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2306 setB[1] = matchDistr(clusterControl, setB[0]);
2307 setC[0] = (Adc[3] - Adc[1])/sqrt(2.0);
2308 setC[1] = matchDistr(clusterControl, setC[0]);
2309 setD[0] = (Adc[3] - Adc[2])/sqrt(2.0);
2310 setD[1] = matchDistr(clusterControl, setD[0]);
2311 setE[0] = (Adc[3] - Adc[6])/sqrt(2.0);
2312 setE[1] = matchDistr(clusterControl, setE[0]);
2313 setF[0] = (Adc[7] - Adc[1])/sqrt(2.0);
2314 setF[1] = matchDistr(clusterControl, setF[0]);
2315 setG[0] = (Adc[7] - Adc[2])/sqrt(2.0);
2316 setG[1] = matchDistr(clusterControl, setG[0]);
2317 setH[0] = (Adc[7] - Adc[6])/sqrt(2.0);
2318 setH[1] = matchDistr(clusterControl, setH[0]);
2319 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]);
2320 probADH = (setA[1]*setD[1]*setH[1])/tmp;
2321 probAEG = (setA[1]*setE[1]*setG[1])/tmp;
2322 probBCH = (setB[1]*setC[1]*setH[1])/tmp;
2323 probBEF = (setB[1]*setE[1]*setF[1])/tmp;
2324 newPointA->setFlag(
int(100*(probADH+probAEG)));
2325 newPointB->setFlag(
int(100*(probBCH+probBEF)));
2326 newPointC->setFlag(
int(100*probBCH));
2327 newPointD->setFlag(
int(100*probADH));
2328 newPointE->setFlag(
int(100*(probAEG+probBEF)));
2329 newPointF->setFlag(
int(100*probBEF));
2330 newPointG->setFlag(
int(100*probAEG));
2331 newPointH->setFlag(
int(100*(probADH+probBCH)));
2332 mPoint->addNewPoint(newPointA);
2333 mPoint->addNewPoint(newPointB);
2334 mPoint->addNewPoint(newPointC);
2335 mPoint->addNewPoint(newPointD);
2336 mPoint->addNewPoint(newPointE);
2337 mPoint->addNewPoint(newPointF);
2338 mPoint->addNewPoint(newPointG);
2339 mPoint->addNewPoint(newPointH);
2344 else if(!strcmp(currentKind,
"1p1n2n3n2p1n2n3n3p1n2n3n"))
2346 StSstPoint *newPointA =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2347 setMatcheds(dimensions, newPointA, currentPackage->getMatched(0), currentPackage->getMatched(1));
2348 newPointA->setEnergyLossCorrected(Adc[0], Adc[1],CalibArray);
2350 StSstPoint *newPointB =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2351 setMatcheds(dimensions, newPointB, currentPackage->getMatched(0), currentPackage->getMatched(2));
2352 newPointB->setEnergyLossCorrected(Adc[0], Adc[2],CalibArray);
2354 StSstPoint *newPointC =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2355 setMatcheds(dimensions, newPointC, currentPackage->getMatched(0), currentPackage->getMatched(3));
2356 newPointC->setEnergyLossCorrected(Adc[0], Adc[3],CalibArray);
2358 StSstPoint *newPointD =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2359 setMatcheds(dimensions, newPointD, currentPackage->getMatched(4), currentPackage->getMatched(1));
2360 newPointD->setEnergyLossCorrected(Adc[4], Adc[1],CalibArray);
2362 StSstPoint *newPointE =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2363 setMatcheds(dimensions, newPointE, currentPackage->getMatched(4), currentPackage->getMatched(2));
2364 newPointE->setEnergyLossCorrected(Adc[4], Adc[2],CalibArray);
2366 StSstPoint *newPointF =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2367 setMatcheds(dimensions, newPointF, currentPackage->getMatched(4), currentPackage->getMatched(3));
2368 newPointF->setEnergyLossCorrected(Adc[4], Adc[3],CalibArray);
2370 StSstPoint *newPointG =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2371 setMatcheds(dimensions, newPointG, currentPackage->getMatched(8), currentPackage->getMatched(1));
2372 newPointG->setEnergyLossCorrected(Adc[8], Adc[1],CalibArray);
2374 StSstPoint *newPointH =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2375 setMatcheds(dimensions, newPointH, currentPackage->getMatched(8), currentPackage->getMatched(2));
2376 newPointH->setEnergyLossCorrected(Adc[8], Adc[2],CalibArray);
2378 StSstPoint *newPointI =
new StSstPoint(mPoint->getSize(), mId, currentPackage->getNPackage(), 33);
2379 setMatcheds(dimensions, newPointI, currentPackage->getMatched(8), currentPackage->getMatched(3));
2380 newPointI->setEnergyLossCorrected(Adc[8], Adc[3],CalibArray);
2383 Double_t setA[2], setB[2], setC[2], setD[2], setE[2], setF[2], setG[2], setH[2], setI[2];
2384 Double_t probAEI, probCEG, probAFH, probBDI, probCDH, probBFG;
2386 setA[0] = (Adc[0] - Adc[1])/sqrt(2.0);
2387 setA[1] = matchDistr(clusterControl, setA[0]);
2388 setB[0] = (Adc[0] - Adc[2])/sqrt(2.0);
2389 setB[1] = matchDistr(clusterControl, setB[0]);
2390 setC[0] = (Adc[0] - Adc[3])/sqrt(2.0);
2391 setC[1] = matchDistr(clusterControl, setC[0]);
2392 setD[0] = (Adc[4] - Adc[1])/sqrt(2.0);
2393 setD[1] = matchDistr(clusterControl, setD[0]);
2394 setE[0] = (Adc[4] - Adc[2])/sqrt(2.0);
2395 setE[1] = matchDistr(clusterControl, setE[0]);
2396 setF[0] = (Adc[4] - Adc[3])/sqrt(2.0);
2397 setF[1] = matchDistr(clusterControl, setF[0]);
2398 setG[0] = (Adc[8] - Adc[1])/sqrt(2.0);
2399 setG[1] = matchDistr(clusterControl, setG[0]);
2400 setH[0] = (Adc[8] - Adc[2])/sqrt(2.0);
2401 setH[1] = matchDistr(clusterControl, setH[0]);
2402 setI[0] = (Adc[8] - Adc[3])/sqrt(2.0);
2403 setI[1] = matchDistr(clusterControl, setI[0]);
2404 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]);
2405 probAEI = (setA[1]*setE[1]*setI[1])/(tmp);
2406 probCEG = (setC[1]*setE[1]*setG[1])/(tmp);
2407 probAFH = (setA[1]*setF[1]*setH[1])/(tmp);
2408 probBDI = (setB[1]*setD[1]*setI[1])/(tmp);
2409 probCDH = (setC[1]*setD[1]*setH[1])/(tmp);
2410 probBFG = (setB[1]*setF[1]*setG[1])/(tmp);
2411 newPointA->setFlag(
int(100*(probAEI+probAFH)));
2412 newPointB->setFlag(
int(100*(probBDI+probBFG)));
2413 newPointC->setFlag(
int(100*(probCEG+probCDH)));
2414 newPointD->setFlag(
int(100*(probBDI+probCDH)));
2415 newPointE->setFlag(
int(100*(probAEI+probCEG)));
2416 newPointF->setFlag(
int(100*(probAFH+probBFG)));
2417 newPointG->setFlag(
int(100*(probCEG+probBFG)));
2418 newPointH->setFlag(
int(100*(probAFH+probCDH)));
2419 newPointI->setFlag(
int(100*(probAEI+probBDI)));
2420 mPoint->addNewPoint(newPointA);
2421 mPoint->addNewPoint(newPointB);
2422 mPoint->addNewPoint(newPointC);
2423 mPoint->addNewPoint(newPointD);
2424 mPoint->addNewPoint(newPointE);
2425 mPoint->addNewPoint(newPointF);
2426 mPoint->addNewPoint(newPointG);
2427 mPoint->addNewPoint(newPointH);
2428 mPoint->addNewPoint(newPointI);
2431 else LOG_INFO<<
" Warning unsolved case ("<<currentKind<<
")\n";
2433 currentPackage=mPackage->next(currentPackage);
2438 Int_t StSstWafer::convertDigitToAnalog(Double_t pairCreationEnergy)
2443 currentPoint->setDe(currentPoint->getDe(0)*pairCreationEnergy,0);
2444 currentPoint->setDe(currentPoint->getDe(1)*pairCreationEnergy,1);
2445 currentPoint = mPoint->next(currentPoint);
2450 Int_t StSstWafer::convertUFrameToLocal(sstDimensions_st *dimensions)
2456 currentPoint->setXl(currentPoint->getPositionU(0)/2.+currentPoint->getPositionU(1)/2.-dimensions[0].waferHalfActLength+dimensions[0].waferHalfActWidth*tan(dimensions[0].stereoAngle),0);
2457 currentPoint->setXl((currentPoint->getPositionU(1)-currentPoint->getPositionU(0))/(2*tan(dimensions[0].stereoAngle)),2);
2458 currentPoint->setXl(0.0,1);
2459 currentPoint = mPoint->next(currentPoint);
2464 Int_t StSstWafer::convertLocalToGlobal() {
2467 while(currentPoint) {
2468 Double_t xl[3] = {currentPoint->getXl(0), currentPoint->getXl(1), currentPoint->getXl(2)};
2469 LocalToMaster(xl,xg);
2470 currentPoint->setXg(xg[0],0);
2471 currentPoint->setXg(xg[1],1);
2472 currentPoint->setXg(xg[2],2);
2473 currentPoint = mPoint->next(currentPoint);
2478 Int_t StSstWafer::convertGlobalToLocal() {
2479 Int_t localSize = (this->mPoint)->getSize();
2480 if (!localSize)
return 0;
2482 for (Int_t i = 0; i < localSize; i++) {
2483 Double_t xg[3] = {temp->getXg(0), temp->getXg(1), temp->getXg(2)};
2485 MasterToLocal(xg,xl);
2486 temp->setXl( xl[0], 0);
2487 temp->setXl( xl[1], 1);
2488 temp->setXl( xl[2], 2);
2489 temp = mPoint->next(temp);
2494 Int_t StSstWafer::convertLocalToUFrame(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge, Float_t Theta)
2496 Int_t localSize = (mPoint)->getSize();
2497 if (!localSize)
return 0;
2500 for (Int_t i = 0; i < localSize; i++)
2503 temp->setUpos((temp->getXl(0)+(ActiveLargeEdge/2.))-(temp->getXl(1)+(ActiveSmallEdge/2.))*tan(Theta), 0);
2504 temp->setUpos((temp->getXl(0)+(ActiveLargeEdge/2.))+(temp->getXl(1)-(ActiveSmallEdge/2.))*tan(Theta), 1);
2505 temp = mPoint->next(temp);
2511 StSstPointList* StSstWafer::getDeadHits(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge,Float_t Test)
2513 StSstPointList *listDeadBorder = getNonActivePointBorder(ActiveLargeEdge,ActiveSmallEdge);
2514 StSstPointList *listDeadTriangle = getNonActivePointTriangle(Test);
2516 listDeadTotal = listDeadTotal->addPointList(listDeadBorder);
2517 listDeadTotal = listDeadTotal->addPointList(listDeadTriangle);
2518 listDeadTotal = listDeadTotal->removeMultipleCount();
2519 (mPoint)->substractPointList(listDeadTotal);
2520 delete listDeadBorder;
2521 delete listDeadTriangle;
2522 return listDeadTotal;
2525 void StSstWafer::convertToStrip(Float_t Pitch,
2526 Int_t nStripPerSide,
2527 Double_t pairCreationEnergy,
2528 Int_t nstripInACluster,
2531 Double_t parIndRightP,
2532 Double_t parIndRightN,
2533 Double_t parIndLeftP,
2534 Double_t parIndLeftN,
2535 Float_t mShift_hole,
2536 Float_t mShift_elec)
2538 convertHitToStrip(Pitch,
2549 convertAnalogToDigit(pairCreationEnergy);
2550 mStripP->sortStrip();
2551 mStripN->sortStrip();
2554 Int_t StSstWafer::printborder()
2557 printf(
"Wafer = %d \n",mId);
2558 Double_t actives[4][3],templs[4][3];
2559 Double_t activee[4][3],temple[4][3];
2561 actives[0][0]=-3.65,actives[1][0]= 3.65,actives[2][0]= 3.65,actives[3][0]=-3.65;
2562 actives[0][1]= 2.00,actives[1][1]= 2.00,actives[2][1]=-2.00,actives[3][1]=-2.00;
2563 actives[0][2]= 0.00,actives[1][2]= 0.00,actives[2][2]= 0.00,actives[3][2]= 0.00;
2565 activee[0][0]= 3.65,activee[1][0]= 3.65,activee[2][0]=-3.65,activee[3][0]=-3.65;
2566 activee[0][1]= 2.00,activee[1][1]=-2.00,activee[2][1]=-2.00,activee[3][1]= 2.00;
2567 activee[0][2]= 0.00,activee[1][2]= 0.00,activee[2][2]= 0.00,activee[3][2]= 0.00;
2568 for (Int_t j = 0; j < 4; j++) {
2569 LocalToMaster(actives[j], templs[j]);
2570 LocalToMaster(activee[j], temple[j]);
2572 const Char_t *xyz[3] = {
"x",
"y",
"z"};
2573 for (Int_t i = 0; i < 3; i++) {
2574 printf(
"%ssSsdLadder%d set {",xyz[i],mId-7100);
2575 for (Int_t j = 0; j < 4; j++) printf(
"%.2f ",templs[j][i]);
2577 printf(
"%seSsdLadder%d set {",xyz[i],mId-7100);
2578 for (Int_t j = 0; j < 4; j++) printf(
"%.2f ",temple[j][i]);
2585 StSstWafer::StSstWafer(
const StSstWafer & originalWafer)
2587 memcpy (first, originalWafer.first, last-first);
2599 memset(first, 0, last-first);
2600 mId = originalWafer.mId;
2601 SetName(originalWafer.GetName());
2602 SetRotation(originalWafer.GetRotationMatrix());
2603 SetTranslation(originalWafer.GetTranslation());
2612 Int_t geomatched = 0;
2613 Int_t numStrip = int((2*dimensions[0].waferHalfActWidth*tan(dimensions[0].stereoAngle)/dimensions[0].stripPitch)+1);
2614 if ( (!ptr1) || (!ptr2) )
2616 else if((ptr2->getStripMean() > ( ptr1->getStripMean() - numStrip))
2617 && (ptr2->getStripMean() < (ptr1->getStripMean() + numStrip)))
2627 Point->setPositionU((pMatched->getStripMean()-1)*dimensions[0].stripPitch,0);
2628 Point->setPositionU((nMatched->getStripMean()-1)*dimensions[0].stripPitch,1);
2629 Point->setIdClusterP(pMatched->getNCluster());
2630 Point->setIdClusterN(nMatched->getNCluster());
2633 Int_t pHitIndex = 0;
2634 Int_t nHitIndex = 0;
2635 Int_t sptHitIndex = 0;
2636 for (pHitIndex = 0; pHitIndex < SST_MAXIDMCHIT; pHitIndex++)
2638 for (nHitIndex = 0; nHitIndex < SST_MAXIDMCHIT; nHitIndex++)
2640 if ((pMatched->getIdMcHit(pHitIndex))
2641 &&(nMatched->getIdMcHit(nHitIndex))
2642 &&(pMatched->getIdMcHit(pHitIndex) == nMatched->getIdMcHit(nHitIndex))
2643 &&(sptHitIndex < SST_MAXIDMCHIT))
2644 Point->setNMchit(pMatched->getIdMcHit(pHitIndex),sptHitIndex++);
2651 Double_t mean = clusterControl->getMatchMean();
2652 Double_t sigm = clusterControl->getMatchSigma();
2653 return TMath::Gaus(x, mean, sigm, 1);
2656 void StSstWafer::addHit(Int_t rNId , Int_t rMcHit, Int_t rMcTrack, Float_t *rXg , Float_t rDe, Float_t *p)
2658 Float_t *alpha =
new float[2];
2662 (mPoint)->addNewPoint(tmpPoint);
2666 StSstPointList* StSstWafer::getNonActivePointBorder(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge)
2668 Int_t localSize = (mPoint)->getSize();
2671 if (!localSize)
return deadPoints;
2674 for (Int_t i = 0; i < localSize; i++)
2676 if((temp->getXl(0) >(ActiveLargeEdge/2.)) || (temp->getXl(0) < (-ActiveLargeEdge/2.)) ||
2677 (temp->getXl(2) >(ActiveSmallEdge/2.)) || (temp->getXl(2) < (-ActiveSmallEdge/2.)))
2681 deadPoints->addNewPoint(badPoint);
2683 temp = (mPoint)->next(temp);
2688 StSstPointList* StSstWafer::getNonActivePointTriangle(Float_t Test)
2691 Int_t localSize = (mPoint)->getSize();
2694 if (!localSize)
return deadPoints;
2697 for (Int_t i = 0; i < localSize; i++)
2699 if (temp->getPositionU(0) < -1.*Test && temp->getPositionU(1) < -1.*Test)
2703 deadPoints->addNewPoint(badPoint);
2705 temp = (mPoint)->next(temp);
2711 Double_t StSstWafer::myErf(Double_t x)
2713 const Double_t a1 = -1.26551223, a2 = 1.00002368,
2714 a3 = 0.37409196, a4 = 0.09678418,
2715 a5 = -0.18628806, a6 = 0.27886807,
2716 a7 = -1.13520398, a8 = 1.48851587,
2717 a9 = -0.82215223, a10 = 0.17087277;
2720 Double_t z = ((x) < 0. ? -(x) : (x));
2722 if (z <= 0)
return (1.-v);
2723 Double_t t = 1./(1.+0.5*z);
2724 v = t*exp((-z*z) +a1+t*(a2+t*(a3+t*(a4+t*(a5+t*(a6+t*(a7+t*(a8+t*(a9+t*a10)))))))));
2726 if (x < 0) v = 2.-v;
2730 void StSstWafer::convertHitToStrip(Float_t Pitch,
2731 Int_t nStripPerSide,
2732 Int_t nstripInACluster,
2735 Double_t parIndRightP,
2736 Double_t parIndRightN,
2737 Double_t parIndLeftP,
2738 Double_t parIndLeftN,
2739 Float_t mShift_hole,
2740 Float_t mShift_elec)
2742 const Double_t parDiff[2]={parDiffP/Pitch,parDiffN/Pitch};
2743 const Double_t parIndRight[2]={parIndRightP,parIndRightN};
2744 const Double_t parIndLeft[2]={parIndLeftP,parIndLeftN};
2746 Int_t *tabInd =
new Int_t[nstripInACluster];
2747 Float_t *tabDe =
new Float_t[nstripInACluster];
2750 Int_t localSize = (mPoint)->getSize();
2751 for (Int_t iPoint = 0; iPoint < localSize; iPoint++)
2753 for (Int_t iSide = 0; iSide < 2; iSide++)
2755 for (Int_t v = 0 ; v < nstripInACluster; v++)
2760 if (Debug()) LOG_DEBUG<<Form(
"Before Lorentz Shift")<<endm;
2761 if (Debug()) LOG_DEBUG<<Form(
"position of the hit : strip P=%f stripN=%f Pitch=%f",ptr->getPositionU(0),ptr->getPositionU(1),Pitch)<<endm;
2762 UndoLorentzShift(ptr,iSide,mShift_hole,mShift_elec,Pitch);
2763 if (Debug()) LOG_DEBUG<<Form(
"After Lorentz Shift\n");
2764 if (Debug()) LOG_DEBUG<<Form(
"position of the hit : strip P=%f stripN=%f Pitch=%f",ptr->getPositionU(0),ptr->getPositionU(1),Pitch)<<endm;
2765 tabInd[0] = (int)(ptr->getPositionU(iSide)/Pitch + 1.);
2766 tabInd[1] = tabInd[0]+1;
2767 tabInd[2] = tabInd[0]-1;
2768 tabInd[3] = tabInd[0]+2;
2769 if (Debug()) LOG_DEBUG<<Form(
"Mean strip=%d strip1=%d strip2=%d strip3=%d",tabInd[0],tabInd[1],tabInd[2],tabInd[3])<<endm;
2770 Double_t rest = (double)(ptr->getPositionU(iSide)/Pitch) - (
double)(tabInd[0]-1);
2771 Double_t Result=0.5*(1.+myErf((rest-0.5)/sqrt(2.)/parDiff[iSide]) );
2772 Float_t TmpDe0 = 0.;
2773 Float_t TmpDe1 = 0.;
2774 tabDe[0] = (1.-Result)*ptr->getDe();
2775 tabDe[1] = Result*ptr->getDe();
2776 tabDe[2] = tabDe[0]*parIndLeft[iSide];
2777 tabDe[3] = tabDe[1]*parIndRight[iSide];
2778 TmpDe0 = tabDe[1]*parIndLeft[iSide];
2779 TmpDe1 = tabDe[0]*parIndRight[iSide];
2782 for (Int_t st = 0; st < nstripInACluster; st++)
2784 if ( tabInd[st] > 0 && tabInd[st] < nStripPerSide+1 )
2786 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());
2787 StSstStrip *newStrip =
new StSstStrip(tabInd[st], ptr->getNId(), ptr->getMcHit(), ptr->getMcTrack(), tabDe[st]);
2791 mStripP->updateStrip(newStrip);
2794 mStripN->updateStrip(newStrip);
2800 ptr = (mPoint)->next(ptr);
2806 void StSstWafer::convertAnalogToDigit(Double_t pairCreationEnergy)
2808 const Double_t ConversionFactor = 1./pairCreationEnergy;
2810 Int_t localSize = mStripP->getSize();
2813 for (i = 0; i < localSize; i++)
2815 curr->setDigitSig((
int)(curr->getAnalogSig()*ConversionFactor));
2816 curr = mStripP->next(curr);
2818 localSize = mStripN->getSize();
2819 curr = mStripN->first();
2820 for (i = 0; i < localSize; i++)
2822 curr->setDigitSig((
int)(curr->getAnalogSig()*ConversionFactor));
2823 curr = mStripN->next(curr);
2827 float* StSstWafer::findAngle(Float_t *p, Float_t *alpha)
2830 Float_t pT[3],pN[3],pD[3];
2839 for (i = 0; i < 3; i++)
2845 for (i = 0; i < 3; i++)
2852 npD = sqrt(pD[0]*pD[0]+pD[1]*pD[1]+pD[2]*pD[2]);
2853 npN = sqrt(pN[0]*pN[0]+pN[1]*pN[1]+pN[2]*pN[2]);
2856 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]));
2857 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]));
2859 alpha[0] = acos(npN/npDN);
2861 sSign = pD[0]*pN[0]+pD[1]*pN[1]+pD[2]*pN[2]+npN*npN;
2862 if (sSign<0.) alpha[0] = -1.*alpha[0];
2864 alpha[1] = acos(npD/npTD);
2865 sSign = pD[0]*pT[0]+pD[1]*pT[1]+pD[2]*pT[2]+npD*npD;
2866 if (sSign<0.) alpha[1] = -1.*alpha[1];
2871 void StSstWafer::addNoiseToStripSignal(
StSpaNoise *ptr, Int_t iSide)
2874 { mNoiseN->addNewNoise(ptr); }
2876 { mNoiseP->addNewNoise(ptr); }
2879 void StSstWafer::setIsActive(Int_t rIsActive, Int_t iSide, Int_t rNStrip)
2882 { mNoiseN->setIsActive(rIsActive, rNStrip); }
2884 { mNoiseP->setIsActive(rIsActive, rNStrip); }
2887 void StSstWafer::sortNoise()
2889 mNoiseP->sortStrip();
2890 mNoiseN->sortStrip();
2893 void StSstWafer::addNoiseToStripSignal(
long nElectronInAMip,
long adcDynamic)
2895 mNoiseP->addSignal(mStripP, nElectronInAMip, adcDynamic);
2896 mNoiseN->addSignal(mStripN, nElectronInAMip, adcDynamic);
2899 void StSstWafer::pedestalSubstraction()
2901 mNoiseP->substractPedestal();
2902 mNoiseN->substractPedestal();
2905 void StSstWafer::zeroSubstraction()
2907 mNoiseP->zeroSubstraction();
2908 mNoiseN->zeroSubstraction();
2911 void StSstWafer::convertAnalogToDigit(Long_t nElectronInAMip,Long_t adcDynamic,
2912 Long_t nbitEncoding, Float_t daqCutValue)
2914 mNoiseP->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2915 nbitEncoding,daqCutValue);
2916 mNoiseN->convertAnalogToDigit(nElectronInAMip, adcDynamic,
2917 nbitEncoding,daqCutValue);
2920 void StSstWafer::updateStripList()
2922 mStripP->updateStripList(mNoiseP);
2923 mStripN->updateStripList(mNoiseN);
2926 void StSstWafer::UndoLorentzShift(
StSstPoint *ptr,Int_t iSide,Float_t mShift_hole,Float_t mShift_elec,Float_t pitch)
2928 Float_t tempPosition = ptr->getPositionU(iSide);
2930 ptr->setPositionU(tempPosition+mShift_hole,iSide);
2934 ptr->setPositionU(tempPosition+mShift_elec,iSide);
void doLorentzShift(sstDimensions_st *dimensions, Float_t mShift_hole, Float_t mShift_elec)
void addPoint(StSstPoint *ptr)
Attaches the ptr point on that wafer.
Int_t doFindPackage(sstDimensions_st *dimensions, StSstClusterControl *clusterControl)
Int_t geoMatched(sstDimensions_st *dimensions, StSstCluster *ptr1, StSstCluster *ptr2)
Determines if two clusters are geometricaly compatible.
void addCluster(StSstCluster *ptr, Int_t iSide)
Attaches the ptr cluster on the iSide of the wafer.
void addStrip(StSstStrip *ptr, Int_t iSide)
Int_t doClusterSplitting(StSstClusterControl *clusterControl, Int_t iSide)
Int_t doFindCluster(StSstClusterControl *clusterControl, Int_t iSide)
Does the cluster finding.
void addPackage(StSstPackage *ptr)
Attaches the ptr package on that wafer.
void setMatcheds(sstDimensions_st *dimensions, StSstPoint *Point, StSstCluster *pMatched, StSstCluster *nMatched)
void doClusterisation(Int_t *numberOfCluster, StSstClusterControl *clusterControl)