26 #include "StMuPmdUtil.h"
28 #include "StEventTypes.h"
29 #include "StMuPmdCluster.h"
30 #include "StMuPmdHit.h"
31 #include "StMuPmdCollection.h"
33 #include "StPhmdDetector.h"
34 #include "StPhmdClusterCollection.h"
35 #include "StPhmdCluster.h"
36 #include "StPhmdModule.h"
37 #include "StPhmdHit.h"
45 StMuPmdUtil::~StMuPmdUtil()
51 if(!phmdColl)
return NULL;
53 fillMuPmd(phmdColl,muPmd);
59 if(!muPmd)
return NULL;
62 fillPmd(muPmd,phmdColl);
71 for(Int_t d=0; d<2; d++){
75 StDetectorId pdet =
static_cast<StDetectorId
>(kPhmdId-d);
80 for(UInt_t j=0;j<12;j++) {
85 StSPtrVecPhmdHit& rawHit=module->hits();
88 totalHit+=rawHit.size();
90 for(Int_t k=0;k<(Int_t)rawHit.size();k++) {
92 muPmd->addHit(PmdDet);
95 Int_t sm=pmdhit->superModule();
96 Int_t det=pmdhit->subDetector();
97 Int_t row=pmdhit->row();
98 Int_t col=pmdhit->column();
99 Float_t energy=pmdhit->energy();
100 Int_t adc=pmdhit->adc();
103 StMuPmdHit *mupmdhit = muPmd->getHit(muPmd->getNHits(PmdDet)-1,PmdDet);
105 mupmdhit->setEnergy(energy);
106 mupmdhit->setADC(adc);
107 mupmdhit->setSuperModule((Short_t)sm);
108 mupmdhit->setSubDetector((Short_t)det);
109 mupmdhit->setRow((Short_t)row);
110 mupmdhit->setColumn((Short_t)col);
122 Int_t Ncluster0 = cluscol->numberOfclusters();
126 const StSPtrVecPhmdCluster& pmdclusters = cluscol->clusters();
128 for(UInt_t i=0; i<pmdclusters.size(); i++)
130 muPmd->addCluster(PmdDet);
133 Int_t sm = pmdcl->module();
134 Int_t ncell = pmdcl->numberOfCells();
135 Float_t eta = pmdcl->eta();
136 Float_t phi = pmdcl->phi();
137 Float_t sigma = pmdcl->sigma();
138 Float_t energy = pmdcl->energy();
139 Int_t energyPID = pmdcl->energyPid();
140 Int_t PID = pmdcl->pid();
141 Int_t mcPID = pmdcl->mcPid();
143 StMuPmdCluster *mupmdcl=muPmd->getCluster(muPmd->getNClusters(PmdDet)-1,PmdDet);
146 mupmdcl->setSuperModule(Int_t(sm));
147 mupmdcl->setNcell(Int_t(ncell));
148 mupmdcl->setEta(Float_t(eta));
149 mupmdcl->setPhi(Float_t(phi));
150 mupmdcl->setSigma(Float_t(sigma));
151 mupmdcl->setEnergy(Float_t(energy));
152 mupmdcl->setEnergyPID(Int_t(energyPID));
153 mupmdcl->setPID(Int_t(PID));
154 mupmdcl->setMcPID(Int_t(mcPID));
168 if(!phmdColl)
return;
170 for(Int_t d=0; d<2; d++) {
171 StDetectorId pdet =
static_cast<StDetectorId
>(kPhmdId-d);
178 Int_t nClusters = muPmd->getNClusters(PmdDet);
185 detector->setCluster(phmdClusColl);
188 for(Int_t n=0; n<nClusters; n++)
193 Int_t sm = muPmdCl->superModule();
194 Int_t nCell = muPmdCl->ncell();
195 Float_t eta = muPmdCl->eta();
196 Float_t phi = muPmdCl->phi();
197 Float_t energy = muPmdCl->energy();
198 Int_t energyPID = muPmdCl->energyPID();
199 Int_t PID = muPmdCl->PID();
200 Int_t McPID = muPmdCl->mcPID();
204 phmdCl->setModule(sm);
205 phmdCl->setNumberOfCells(nCell);
208 phmdCl->setEnergy(energy);
209 phmdCl->setEnergyPid(energyPID);
211 phmdCl->setMcPid(McPID);
213 phmdClusColl->addCluster(phmdCl);
220 Int_t nHits = muPmd->getNHits(PmdDet);
223 for(Int_t nh=0; nh<nHits; nh++) {
225 StMuPmdHit *muPmdHit = muPmd->getHit(nh,PmdDet);
228 Float_t energy= muPmdHit->energy();
229 Int_t ADC= muPmdHit->adc();
230 Int_t sm= muPmdHit->superModule();
231 Int_t subDet= muPmdHit->subDetector();
232 Int_t row= muPmdHit->row();
233 Int_t col= muPmdHit->column();
236 phmdHit->setSuperModule(sm);
237 phmdHit->setEnergy(energy);
238 phmdHit->setAdc(ADC);
239 phmdHit->setSubDetector(subDet);
240 phmdHit->setRow(row);
241 phmdHit->setColumn(col);
242 detector->addHit(phmdHit);