3 #include "StTofCollection.h"
4 #include "StMuTofUtil.h"
5 #include "StMuTofHitCollection.h"
12 StMuTofUtil::~StMuTofUtil()
17 if(!tofcol)
return NULL;
19 fillMuTofHit(muTofHit, tofcol);
26 if(!tofcol || (!tofcol->dataPresent()&&!tofcol->rawdataPresent()))
return;
30 if( ( tofcol->cellsPresent() || tofcol->slatsPresent() ) &&
31 tofcol->hitsPresent() ) {
32 StSPtrVecTofHit &tofHits = tofcol->tofHits();
33 StSPtrVecTofCell &tofCell = tofcol->tofCells();
34 StSPtrVecTofSlat &tofSlat = tofcol->tofSlats();
36 for(
size_t i=0; i < tofHits.size(); i++) {
38 tofMuHit->setIconf(1);
39 tofMuHit->setTrayIndex(tofHits[i]->trayIndex());
40 tofMuHit->setModuleIndex(tofHits[i]->moduleIndex());
41 tofMuHit->setCellIndex(tofHits[i]->cellIndex());
42 tofMuHit->setDaqIndex(tofHits[i]->daqIndex());
43 tofMuHit->setTimeOfFlight(tofHits[i]->timeOfFlight());
44 tofMuHit->setPathLength(tofHits[i]->pathLength());
45 tofMuHit->setBeta(tofHits[i]->beta());
46 tofMuHit->setAssociatedTrackId(tofHits[i]->associatedTrack()->key());
47 if(tofHits[i]->trayIndex()!=0&&tofHits[i]->moduleIndex()!=0) {
48 tofMuHit->setADC((
int)tofCell[tofHits[i]->cellCollIndex()]->adc());
49 StThreeVectorD hitpos = tofCell[tofHits[i]->cellCollIndex()]->position();
50 StThreeVectorF hitpos1((Float_t)(hitpos.x()),(Float_t)(hitpos.y()),(Float_t)(hitpos.z()));
51 tofMuHit->setProjectedPoint(hitpos1);
54 tofMuHit->setADC((
int)tofSlat[tofHits[i]->cellCollIndex()]->adc());
55 tofMuHit->setProjectedPoint((
StThreeVectorF&)tofSlat[tofHits[i]->cellCollIndex()]->position());
57 tofMuHit->settofExpectedAsElectron(tofHits[i]->tofExpectedAsElectron());
58 tofMuHit->settofExpectedAsPion(tofHits[i]->tofExpectedAsPion());
59 tofMuHit->settofExpectedAsKaon(tofHits[i]->tofExpectedAsKaon());
60 tofMuHit->settofExpectedAsProton(tofHits[i]->tofExpectedAsProton());
61 tofMuHit->setsigmaElectron(tofHits[i]->sigmaElectron());
62 tofMuHit->setsigmaPion(tofHits[i]->sigmaPion());
63 tofMuHit->setsigmaKaon(tofHits[i]->sigmaKaon());
64 tofMuHit->setsigmaProton(tofHits[i]->sigmaProton());
67 muTofHit->push_back(tofMuHit);