StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGammaRawMaker.cxx
1 #include "StMessMgr.h"
2 
3 #include "StEEmcPool/StEEmcA2EMaker/StEEmcA2EMaker.h"
4 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h"
5 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
6 
7 #include "StEventTypes.h"
8 
9 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
10 #include "StMuDSTMaker/COMMON/StMuDst.h"
11 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
12 #include "StMuDSTMaker/COMMON/StMuTrack.h"
13 
14 #include "StEmcUtil/geometry/StEmcGeom.h"
15 #include "StEmcUtil/others/emcDetectorName.h"
16 #include "StEmcADCtoEMaker/StBemcData.h"
17 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
18 #include "StEmcRawMaker/defines.h"
19 #include "StEmcRawMaker/StBemcRaw.h"
20 #include "StEmcRawMaker/StBemcTables.h"
21 #include "StEmcRawMaker/StEmcRawMaker.h"
22 
23 #include "StGammaRawMaker.h"
24 
25 ClassImp(StGammaRawMaker);
26 
28 // Constructor //
30 StGammaRawMaker::StGammaRawMaker(const char *name): StMaker(name)
31 {
32 
33  SetTowerCutoff(0.0);
34  SetTrackCutoff(0.0);
35 
36  mUseBemc = false;
37  mUseEemc = false;
38 
39  mBemcGainShift = 0.0;
40 
41 }
42 
44 // Destructor //
46 StGammaRawMaker::~StGammaRawMaker()
47 {}
48 
50 // Maker Init //
52 Int_t StGammaRawMaker::Init()
53 {
54 
55  mEEmcGeometry = new EEmcGeomSimple();
56  mTables = new StBemcTables();
57  mCorrupt = false;
58 
59  return StMaker::Init();
60 
61 }
62 
64 // Maker Clear //
66 void StGammaRawMaker::Clear(Option_t *opts)
67 {
68 
69  // Clear detector object vectors
70  mTracks.clear();
71  mTowers.clear();
72  mStrips.clear();
73  mPreshower1.clear();
74  mPreshower2.clear();
75  mPostshower.clear();
76 
77  // for efficiency, we could clear only those elements which have been "hit"
78  for (Int_t index = 0; index < kEEmcNumSectors * kEEmcNumSubSectors * kEEmcNumEtas; index++)
79  {
80 
81  for(Int_t layer = 0; layer < 4; layer++)
82  {
83 
84  mEEtowers[index][layer] = 0;
85 
86  for(Int_t sec = 0; sec < kEEmcNumSectors; sec++)
87  {
88 
89  for(Int_t plane = 0; plane < kEEmcNumSmdUVs; plane++)
90  {
91 
92  for(Int_t strip = 0; strip < kEEmcNumStrips; strip++)
93  {
94 
95  mEEstrips[sec][plane][strip] = 0;
96 
97  }
98 
99  } // Planes
100 
101  } // Sectors
102 
103  } // Layers
104 
105  } // Index
106 
107  // Clear BTOW and BPRS arrays of pointers
108  memset(mBarrelEmcTower, 0, sizeof(mBarrelEmcTower));
109  memset(mBarrelEmcPreshower, 0, sizeof(mBarrelEmcPreshower));
110 
111  // Clear BSMDE and BSMDP maps
112  mBarrelSmdEtaStrip.clear();
113  mBarrelSmdPhiStrip.clear();
114 
115 }
116 
118 // Maker Make //
121 {
122 
123  mMuDstMaker = dynamic_cast<StMuDstMaker*>(GetMakerInheritsFrom("StMuDstMaker"));
124  if(!mMuDstMaker)
125  {
126  LOG_WARN << "Make - No MuDst found!" << endm;
127  return kStWarn;
128  }
129 
130  // Retrieve StGammaEventMaker from the chain
131  mGammaEvent = 0;
132 
133  if(!GetMaker("mGammaEventMaker"))
134  {
135  LOG_WARN << "StGammaEventMaker not in chain, no tree for you" << endm;
136  return kStWarn;
137  }
138  else
139  {
140  StGammaEventMaker *mGammaEventMaker = dynamic_cast<StGammaEventMaker*>(GetMakerInheritsFrom("StGammaEventMaker"));
141  mGammaEvent = mGammaEventMaker->event();
142  }
143 
144  // Retrieve MuDst
145  if(!GetDataSet("MuDst"))
146  {
147  LOG_WARN << "No MuDst" << endm;
148  return kStWarn;
149  }
150 
151  // Skip events without a reconstructed vertex
152  if(!StMuDst::numberOfPrimaryVertices() ) return kStOK;
153 
154  GetTracks();
155  if(mUseBemc) GetBarrel();
156  if(mUseEemc) GetEndcap();
157 
158  return kStOk;
159 
160 }
161 
163 // Retrieve (primary) track information //
165 void StGammaRawMaker::GetTracks()
166 {
167 
168  // Retrieve MuDst
169  if(!GetDataSet("MuDst"))
170  {
171  LOG_WARN << "No MuDst" << endm;
172  return;
173  }
174 
175  // Loop over primary tracks and store in StGammaEvent
176 
177  //TIter next(StMuDst::globalTracks()); // do we want global tracks here?????
178  TIter next(StMuDst::primaryTracks());
179 
180  while(StMuTrack* track = (StMuTrack*)next())
181  {
182 
183  if(track->momentum().perp() < mTrackCutoff) continue;
184 
185  if(Accept(track))
186  {
187  StGammaTrack *mGammaTrack = mGammaEvent->newTrack(track);
188  mTracks.push_back(*mGammaTrack);
189  }
190 
191  }
192 
193 }
194 
196 // Retrieve BEMC tower, preshower, //
197 // and SMD information //
199 void StGammaRawMaker::GetBarrel()
200 {
201 
202  // Load status tables
203  mTables->loadTables(this);
204 
205  // Retrieve BEMC detector collection
206  // Retrieve MuDst
207  if(!GetDataSet("MuDst"))
208  {
209  LOG_WARN << "No MuDst" << endm;
210  return;
211  }
212 
213  StEmcCollection *emc = 0;
214 
215  StEvent *event = dynamic_cast<StEvent*>( GetInputDS("StEvent") );
216  emc = event ? event->emcCollection() : StMuDst::emcCollection();
217  if(!emc) return;
218 
219  StEmcDetector* btow = emc->detector(kBarrelEmcTowerId); // BTOW
220  StEmcDetector* bprs = emc->detector(kBarrelEmcPreShowerId); // BPRS
221  StEmcDetector* smde = emc->detector(kBarrelSmdEtaStripId); // SMDE
222  StEmcDetector* smdp = emc->detector(kBarrelSmdPhiStripId); // SMDP
223 
224  // Check for corruption in the detectors
225  mCorrupt = false;
226 
227  // StEmcDetector == NULL implies corruption for pre-October 2004 BEMC code
228  if(!btow)
229  {
230  mCorrupt = true;
231  return;
232  }
233 
234  // Check for corruption in post-October 2004 BEMC code
235  // Crate corruption key:
236  // crateUnknown = 0
237  // crateNotPresent = 1
238  // crateOK = 2
239  // crateHeaderCorrupt = 3
240  for(int crate = 1; crate <= MAXCRATES; crate++)
241  {
242  StEmcCrateStatus crateStatus = btow->crateStatus(crate);
243  if(crateStatus == crateHeaderCorrupt)
244  {
245  mCorrupt = true;
246  return;
247  }
248  }
249 
250  /*
251  //And now we can implement Alex's new StEmcAdc2EMaker test
252  StEmcADCtoEMaker *adc2e = dynamic_cast<StGammaEventMaker*>GetMakerInheritsFrom("StEmcADCtoEMaker");
253  if(adc2e)
254  {
255  mCorrupt = adc2e->isCorrupted();
256  if(mCorrupt == true) return;
257  }
258  else
259  {
260  LOG_DEBUG << "GetBarrel() - StEmcADCtoEMaker not found in chain" << endl;
261  }
262  */
263 
264 
265  // Instantiate Variables
266  float pedestal;
267  float rms;
268  float bEta;
269  float bPhi;
270  int CAP=0; //this argument matters only for SMD
271 
272 
273  // Loop over BEMC modules to access tower and preshower information
274  for(int m = 1; m <= 120; m++)
275  {
276 
277  // Retrieve tower information if the collection exists
278  if(btow)
279  {
280 
281  StEmcGeom *geom = StEmcGeom::instance("bemc");
282  StEmcModule *module = btow->module(m);
283 
284  StSPtrVecEmcRawHit& rawHits = module->hits();
285 
286  //loop on hits in modules
287  for(UInt_t k = 0; k < rawHits.size(); k++)
288  {
289 
290  StEmcRawHit* tempRawHit = rawHits[k];
291 
292  int id = tempRawHit->softId(BTOW);
293 
294  // Ignore excluded towers
295  bool excludedTower = false;
296 
297  for(UInt_t i = 0; i < mExcludedBemcTowers.size(); ++i)
298  {
299  if(id == mExcludedBemcTowers.at(i)) excludedTower = true;
300  }
301 
302  if(excludedTower)
303  {
304  LOG_DEBUG << " Excluding tower "<< id << endm;
305  continue;
306  }
307 
308  int status;
309  int ADC = tempRawHit->adc(); //not pedestal subtracted!
310  double energy = tempRawHit->energy();
311  float x, y, z;
312  geom->getXYZ(id, x, y, z);
313  TVector3 position(x, y, z);
314  position -= TVector3(StMuDst::event()->primaryVertexPosition().xyz());
315  bEta = position.Eta();
316  bPhi = position.Phi();
317  mTables->getStatus(BTOW, id, status);
318  mTables->getPedestal(BTOW, id, CAP, pedestal, rms);
319 
320  // Require signal significantly above pedestal
321  if(ADC < 7) continue;
322  double pADC = ADC - pedestal;
323  if(pADC < 5.0 * rms) continue;
324 
325  // Vary energy per gain shift
326  energy = (1.0 + mBemcGainShift) * energy;
327 
328  // min pT cut next
329  if ( energy / TMath::CosH(bEta) < mTowerCutoff ) continue;
330 
331  StGammaTower *btower = mGammaEvent->newTower();
332 
333  btower->id = id;
334  btower->layer = kBEmcTower;
335  btower->stat = status;
336  btower->fail = (int)(status != 1);
337  btower->energy = energy;
338  btower->eta = bEta;
339  btower->phi = bPhi;
340 
341  LOG_DEBUG << " TowerID =" << id << ", Status = " << status << ", Energy = " << energy << endm;
342  LOG_DEBUG << " Eta = " << bEta << ", Phi = " << bPhi << ", ADC = " << ADC << endm;
343 
344 
345  mTowers.push_back(*btower);
346  mBarrelEmcTower[btower->id] = btower;
347 
348  }
349 
350  }
351 
352  // Retrieve preshower information if the collection exists
353  if(bprs)
354  {
355 
356  StEmcGeom* geom = StEmcGeom::instance("bprs");
357  StEmcModule* module = bprs->module(m);
358  StSPtrVecEmcRawHit& rawHits=module->hits();
359 
360  // Loop over hits
361  for(UInt_t k = 0; k < rawHits.size(); k++)
362  {
363 
364  StEmcRawHit* tempRawHit = rawHits[k];
365  int id, bprs_status;
366  int ADC = tempRawHit->adc();
367  double energy = tempRawHit->energy();
368  id = tempRawHit->softId(BPRS);
369  float x, y, z;
370  geom->getXYZ(id,x,y,z);
371  TVector3 position(x, y, z);
372  position -= TVector3(StMuDst::event()->primaryVertexPosition().xyz());
373  bEta = position.Eta();
374  bPhi = position.Phi();
375  mTables->getStatus(BPRS, id, bprs_status);
376  mTables->getPedestal(BPRS, id, CAP, pedestal, rms);
377 
378  // Require signal significantly above pedestal
379  if(ADC < 15) continue;
380  double pADC = ADC-pedestal;
381  if ( pADC < 5.0 * rms ) continue;
382 
383  StGammaTower *mPreShower = mGammaEvent->newPreshower1();
384 
385  mPreShower->id = id;
386  mPreShower->layer = kBEmcPres;
387  mPreShower->stat = bprs_status;
388  mPreShower->fail = (int)(bprs_status != 1);
389  mPreShower->energy = energy;
390  mPreShower->eta = bEta;
391  mPreShower->phi = bPhi;
392 
393  LOG_DEBUG << " BPRS ID =" << id << ", Status = " << bprs_status << ", Energy = " << energy << endm;
394  LOG_DEBUG << " Eta = " << bEta << ", Phi = " << bPhi << ", ADC = " << ADC << endm;
395 
396  mPreshower1.push_back(*mPreShower);
397 
398  }
399 
400  }
401 
402  } // Modules
403 
404  // Retrieve SMDE information if the collection exists
405  if(smde)
406  {
407 
408  StEmcGeom* geom = StEmcGeom::instance("bsmde");
409 
410  for (UInt_t i = 1; i <= smde->numberOfModules(); i++)
411  {
412 
413  StEmcModule* module = smde->module(i);
414  if (module)
415  {
416 
417  StSPtrVecEmcRawHit& hits = module->hits();
418 
419  for (size_t k = 0; k < hits.size(); ++k)
420  {
421 
422  StEmcRawHit* hit = hits[k];
423  Int_t smde_id = hit->softId(BSMDE);
424 
425  Int_t smde_status = 0;
426  mTables->getStatus(BSMDE,smde_id,smde_status);
427  mTables->getPedestal(BSMDE, smde_id, hit->calibrationType(), pedestal, rms);
428 
429  Float_t eta = -999;
430  geom->getEta(smde_id,eta);
431 
432  // Remove strips too close to pedestal
433  if( (hit->adc() - pedestal) < 3.0 * rms) continue;
434 
435  StGammaStrip *bstrip = mGammaEvent->newStrip();
436 
437  bstrip->index = smde_id;
438  bstrip->sector = hit->module();
439  bstrip->plane = kBEmcSmdEta;
440  bstrip->stat = smde_status;
441  bstrip->fail = (int)(smde_status != 1);
442  bstrip->energy = hit->energy();
443  bstrip->adc = hit->adc();
444  bstrip->position = 230.705 * sinh(eta);
445 
446  double offset = fabs(eta) < 0.5 ? 0.73 : 0.94;
447 
448  bstrip->right = bstrip->position + offset;
449  bstrip->left = bstrip->position - offset;
450 
451  LOG_DEBUG << " eStrip ID =" << smde_id << ", Status = " << smde_status << endm;
452  LOG_DEBUG << " Energy = " << hit->energy() << ", Module = " << hit->module() << endm;
453 
454  mStrips.push_back(*bstrip);
455  mBarrelSmdEtaStrip[bstrip->index] = bstrip;
456 
457  } // Hits
458 
459  } // if(module)
460 
461  } // Modules
462 
463  } // if(smde)
464 
465  // Retrieve SMDP information if the collection exists
466  if(smdp)
467  {
468 
469  StEmcGeom* geom = StEmcGeom::instance("bsmdp");
470 
471  for (UInt_t i = 1; i <= smdp->numberOfModules(); i++)
472  {
473 
474  StEmcModule* module = smdp->module(i);
475  if(module)
476  {
477 
478  StSPtrVecEmcRawHit& hits = module->hits();
479  for (size_t k = 0; k < hits.size(); ++k)
480  {
481 
482  StEmcRawHit* hit = hits[k];
483  Int_t smdp_id = hit->softId(BSMDP);
484 
485  Int_t smdp_status = 0;
486  mTables->getStatus(BSMDP,smdp_id,smdp_status);
487  mTables->getPedestal(BSMDP, smdp_id, hit->calibrationType(), pedestal, rms);
488 
489  Float_t phi = -999;
490  geom->getPhi(smdp_id,phi);
491 
492  // Remove strips too close to pedestal
493  if( (hit->adc() - pedestal) < 3.0 * rms) continue;
494 
495  StGammaStrip *bstrip = mGammaEvent->newStrip();
496 
497  bstrip->index = smdp_id;
498  bstrip->sector = hit->module();
499  bstrip->plane = kBEmcSmdPhi;
500  bstrip->stat = smdp_status;
501  bstrip->fail = (int)(smdp_status != 1);
502  bstrip->energy = hit->energy();
503  bstrip->adc = hit->adc();
504  bstrip->position = phi;
505 
506  double offset = 0.00293;
507 
508  bstrip->left = phi - offset;
509  bstrip->right = phi + offset;
510 
511  LOG_DEBUG << " pStrip ID =" << smdp_id << ", Status = " << smdp_status << endm;
512  LOG_DEBUG << " Energy = " << hit->energy() << ", Module = " << hit->module() << endm;
513 
514  mStrips.push_back(*bstrip);
515  mBarrelSmdPhiStrip[bstrip->index] = bstrip;
516 
517  } // Hits
518 
519  } // if(module)
520 
521  } // Modules
522 
523  } // if(smdp)
524 
525  return;
526 
527 }
528 
530 // Retrieve BEMC tower, preshower, //
531 // postshower, and SMD information //
533 void StGammaRawMaker::GetEndcap()
534 {
535 
536 
537  // Retrieve vertex information
538  StMuPrimaryVertex *primaryVertex = mMuDstMaker->muDst()->primaryVertex();
539  if(!primaryVertex) return; // we're going to need tracking, therefore vertex
540 
541  Float_t zvertex = primaryVertex->position().z();
542 
543  // Retrieve StEEmcA2eMaker
544  StEEmcA2EMaker *adc2e = dynamic_cast<StEEmcA2EMaker*>(GetMakerInheritsFrom("StEEmcA2EMaker"));
545  if (!adc2e)
546  {
547  LOG_WARN << "GetEndcap() - StEEmcA2EMaker not found!" << endm;
548  return;
549  }
550 
551  // Define depths for determining the momentum of each detector element
552  const Float_t depths[] =
553  {
554  kEEmcZSMD, // Towers go to SMD depth
555  kEEmcZPRE1, // Pre/postshowers go to their own depth
556  kEEmcZPRE2,
557  kEEmcZPOST
558  };
559 
560  Int_t enumerations[] = {kEEmcTower, kEEmcPre1, kEEmcPre2, kEEmcPost };
561 
562  // Loop over endcap layers
563  for(Int_t layer = 0; layer < 4; layer++)
564  {
565 
566  // Loop over hits in the current layer
567  for (Int_t ihit = 0; ihit < adc2e->numberOfHitTowers(layer); ihit++)
568  {
569 
570  StEEmcTower tower = adc2e->hittower(ihit, layer);
571 
572  UInt_t sec = (UInt_t)tower.sector();
573  UInt_t sub = (UInt_t)tower.subsector();
574  UInt_t eta = (UInt_t)tower.etabin();
575 
576  TVector3 center = mEEmcGeometry->getTowerCenter(sec,sub,eta);
577  Float_t depth = depths[layer];
578  center.SetMag( depth/center.CosTheta() );
579 
580  Float_t R = center.Perp();
581  Float_t Z = depth-zvertex;
582  Float_t TanTheta = R/Z;
583  Float_t Phi = center.Phi();
584 
585  TVector3 Momentum;
586  Momentum.SetMagThetaPhi(tower.energy(), TMath::ATan(TanTheta), Phi );
587 
588  StGammaTower *etower = 0;
589 
590  if(layer == 0) etower = mGammaEvent->newTower();
591  else if (layer == 1) etower = mGammaEvent->newPreshower1();
592  else if (layer == 2) etower = mGammaEvent->newPreshower2();
593  else if (layer == 3) etower = mGammaEvent->newPostshower();
594 
595  etower->id = tower.index();
596  etower->layer = enumerations[ tower.layer() ];
597  etower->stat = tower.stat();
598  etower->fail = tower.fail();
599  etower->energy = tower.energy();
600  etower->eta = Momentum.Eta();
601  etower->phi = Momentum.Phi();
602 
603  if( Accept(*etower) )
604  {
605 
606  if(layer == 0)
607  {
608 
609  if( etower->energy / TMath::CosH(etower->eta) > mTowerCutoff )
610  {
611  mTowers.push_back(*etower);
612  mEEtowers[ etower->id ][ etower->layer ] = etower;
613  }
614 
615  }
616  else if(layer == 1)
617  {
618  mPreshower1.push_back(*etower);
619  mEEtowers[ etower->id ][ etower->layer ] = etower;
620  }
621  else if(layer == 2)
622  {
623  mPreshower2.push_back(*etower);
624  mEEtowers[ etower->id ][ etower->layer ] = etower;
625  }
626  else if(layer == 3)
627  {
628  mPostshower.push_back(*etower);
629  mEEtowers[ etower->id ][ etower->layer ] = etower;
630  }
631  else continue;
632 
633  } // if(Accept)
634 
635  } // Hits
636 
637  } // Layers
638 
639  // Loop over SMD strips
640  Int_t smdenum[] = {kEEmcSmdu, kEEmcSmdv};
641 
642  for (Int_t sector = 0; sector < 12; sector++)
643  {
644 
645  for(Int_t plane = 0; plane < 2; plane++)
646  {
647 
648  for (Int_t ihit = 0; ihit < adc2e->numberOfHitStrips(sector, plane); ihit++)
649  {
650 
651  StEEmcStrip strip = adc2e->hitstrip(sector, plane, ihit);
652 
653  StGammaStrip *gstrip = mGammaEvent->newStrip();
654  gstrip->index = strip.index();
655  gstrip->sector = strip.sector();
656  gstrip->plane = smdenum[ strip.plane() ];
657  gstrip->stat = strip.stat();
658  gstrip->fail = strip.fail();
659  gstrip->energy = strip.energy();
660 
661  mEEstrips[ gstrip->sector ][ gstrip->plane ][ gstrip->index ]= gstrip;
662 
663  if( Accept(*gstrip) )
664  {
665  mStrips.push_back(*gstrip);
666  }
667 
668  } // Hits
669 
670  } // Planes
671 
672  } // Sectors
673 
674 }
675 
677 // Check StGammaTrack behavior //
679 Bool_t StGammaRawMaker::Accept(StGammaTrack &track)
680 {
681  return true;
682 }
683 
685 // Check StGammaTower behavior //
687 Bool_t StGammaRawMaker::Accept( StGammaTower &tower )
688 {
689 
690  if(tower.fail) return false;
691 
692  return true;
693 
694 }
695 
697 // Check StGammaStrip behavior //
699 Bool_t StGammaRawMaker::Accept( StGammaStrip &strip )
700 {
701 
702  if(strip.fail) return false;
703 
704  return true;
705 
706 }
707 
709 // Check StMuTrack behavior //
711 Bool_t StGammaRawMaker::Accept( StMuTrack* track )
712 {
713 
714  return (track->flag() > 0 && // Good fit
715  track->flag() / 100 != 7 && // FTPC only
716  track->flag() / 100 != 8 && // FTPC+primary vertex
717  track->flag() / 100 != 9 && // Beam background
718  (double)track->nHitsFit() / (double)track->nHitsPoss() > 0.51 );
719 
720 }
721 
722 
724 // Return pointer to tower with //
725 // given id and layer //
726 // //
727 // 0 - Endcap Tower //
728 // 1 - Endcap Preshower 1 //
729 // 2 - Endcap Preshower 2 //
730 // 3 - Endcap Postshower //
731 // //
732 // 10 - Barrel Tower //
733 // 11 - Barrel Preshower //
734 // //
736 StGammaTower *StGammaRawMaker::tower(Int_t id, Int_t layer)
737 {
738 
739  if (layer >= kEEmcTower && layer <= kEEmcPost)
740  {
741  return mEEtowers[id][layer];
742  }
743  else if(layer == kBEmcTower)
744  {
745  return mBarrelEmcTower[id];
746  }
747  else if(layer == kBEmcPres)
748  {
749  return mBarrelEmcPreshower[id];
750  }
751 
752  return 0;
753 
754 }
755 
757 // Return pointer to strip with //
758 // given sector, plane, and index //
759 // //
760 // Plane: //
761 // 1 - ESMD U Plane //
762 // 2 - ESMD V Plane //
763 // //
764 // 10 - BSMD Eta Plane //
765 // 11 - BSMD Phi Plane //
766 // //
768 StGammaStrip *StGammaRawMaker::strip(Int_t sec, Int_t plane, Int_t index)
769 {
770 
771  if(plane == kEEmcSmdu || plane == kEEmcSmdv)
772  {
773  return mEEstrips[sec][plane][index];
774  }
775  else if(plane == kBEmcSmdEta)
776  {
777  return mBarrelSmdEtaStrip[index];
778  }
779  else if(plane == kBEmcSmdPhi)
780  {
781  return mBarrelSmdPhiStrip[index];
782  }
783 
784  return 0;
785 
786 }
787 
789 // Add eta strip from external source //
791 void StGammaRawMaker::AddEtaStrip(StGammaStrip *strip)
792 {
793 
794  int smdStatus = 0;
795 
796  mTables->getStatus(BSMDE, strip->index, smdStatus);
797 
798  strip->stat = smdStatus;
799  strip->fail = (int)(smdStatus != 1);
800 
801  mStrips.push_back(*strip);
802  mBarrelSmdEtaStrip[strip->index] = strip;
803 
804  return;
805 
806 }
807 
809 // Add eta strip from external source //
811 void StGammaRawMaker::AddPhiStrip(StGammaStrip *strip)
812 {
813 
814  int smdStatus = 0;
815 
816  mTables->getStatus(BSMDP, strip->index, smdStatus);
817 
818  strip->stat = smdStatus;
819  strip->fail = (int)(smdStatus != 1);
820 
821  mStrips.push_back(*strip);
822  mBarrelSmdPhiStrip[strip->index] = strip;
823 
824  return;
825 
826 }
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Definition: StMuDst.h:322
EEmc ADC –&gt; energy maker.
void stat(unsigned s)
Set a status bit for this element.
Definition: StEEmcElement.h:23
StGammaTower * newPostshower()
Add a new preshower2 element.
StMuDst * muDst()
Definition: StMuDstMaker.h:425
StEEmcTower & hittower(Int_t hit, Int_t layer)
void layer(Int_t l)
Sets the layer, [0-4]=[TPQR].
Definition: StEEmcTower.h:31
void Clear(Option_t *opts="")
User defined functions.
StEEmcStrip & hitstrip(Int_t sec, Int_t pl, Int_t hit)
StGammaTower * newPreshower1()
Add a new tower.
Int_t numberOfHitStrips(Int_t sector, Int_t plane) const
StGammaTower * newTower()
Add a new track.
void getPedestal(Int_t det, Int_t softId, Int_t cap, Float_t &ped, Float_t &rms) const
Return pedestal mean and rms.
Int_t numberOfHitTowers(Int_t layer) const
Int_t etabin() const
Returns the etabin of this tower, pre- or postshower element.
Definition: StEEmcTower.h:45
void fail(unsigned f)
Set a fail bit for this element.
Definition: StEEmcElement.h:25
StGammaTower * newPreshower2()
Add a new preshower1 (bprs) element.
StGammaTrack * newTrack(StMuTrack *mutr=0)
Returns tower pT in eta range.
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
Int_t subsector() const
Returns subsector of this tower, pre- or postshower element.
Definition: StEEmcTower.h:43
short flag() const
Returns flag, (see StEvent manual for type information)
Definition: StMuTrack.h:230
void loadTables(StMaker *anyMaker)
load tables.
void index(Int_t i)
Sets the index for this SMD strip, 0..287.
Definition: StEEmcStrip.cxx:32
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StGammaStrip * newStrip()
Add a new postshower element.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
Int_t sector() const
Returns sector of this tower, pre- or postshower element.
Definition: StEEmcTower.h:41
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Definition: Stypes.h:42
EEMC simple geometry.
Definition: Stypes.h:40
static StEmcCollection * emcCollection()
returns pointer to current StEmcCollection
Definition: StMuDst.h:405
void getStatus(Int_t det, Int_t softId, Int_t &status, const char *option="") const
Return status.
void plane(Int_t p)
Sets the plane for this SMD strip, 0=U, 1=V.
Definition: StEEmcStrip.h:19
void sector(Int_t s)
Sets the sector for this SMD strip.
Definition: StEEmcStrip.h:17
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
Definition: StEEmcElement.h:21
Base class for describing an endcap SMD strip.
Definition: StEEmcStrip.h:8
Definition: Stypes.h:41