StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsCalibMaker.cxx
1 #include "StFmsCalibMaker.h"
2 #include "StFmsCalibMakerQa.h"
3 ClassImp(StFmsCalibMaker);
4 
5 #include "Stypes.h"
6 #include "StMessMgr.h"
7 #include "StLorentzVectorF.hh"
8 
9 #include "StEnumerations.h"
10 #include "StEventTypes.h"
11 #include "StEvent/StEvent.h"
12 #include "StEvent/StFmsCollection.h"
13 #include "StEvent/StFmsHit.h"
14 #include "StEvent/StFmsPoint.h"
15 #include "StEvent/StFmsPointPair.h"
16 #include "StEvent/StTriggerData.h"
17 #include "StEvent/StTriggerId.h"
18 #include "StFmsDbMaker/StFmsDbMaker.h"
19 #include "StMessMgr.h"
20 #include "StMuDSTMaker/COMMON/StMuEvent.h"
21 #include "StMuDSTMaker/COMMON/StMuTypes.hh"
22 #include "Stypes.h"
23 
24 #include <TFile.h>
25 #include <TTree.h>
26 #include <TLeaf.h>
27 #include <TH1.h>
28 #include <TH2.h>
29 #include <TString.h>
30 
31 #include <cmath>
32 #include <iostream>
33 #include <fstream>
34 #include <map>
35 using namespace std;
36 
37 //--------------------------------------------------
38 void StFmsCalibMaker::ReadCellStat(const char* list)
39 {
40  mReadCellStat = true;
41  cout <<Form("Reading cell status from %s...", list) <<endl;
42 
43  int detId, ch, stat, nBad = 0, nDead = 0;
44  ifstream in;
45  in.open(list);
46  if (!in.is_open())
47  {
48  LOG_ERROR <<"StFmsCalibMaker::ReadCellStat - cannot find the list!\n" <<endm;
49  return;
50  }
51  while (in.is_open())
52  {
53  in >> detId >> ch >> stat; //0 for not bad/dead, 1 for bad, 2 for dead, and 9 for converged
54  if (!in.good()) break;
55 
56  mCellStat[detId-8].insert(std::pair<int, int>(ch, stat));
57  if (stat==BAD) { cout <<Form("%2i %3i, %i", detId, ch, stat) <<endl; nBad++; }
58  if (stat==DEAD) { cout <<Form("%2i %3i, %i", detId, ch, stat) <<endl; nDead++; }
59  }
60  in.close();
61  in.clear();
62  cout <<Form("Total # of bad/dead channels: %i/%i \n", nBad, nDead) <<endl;
63 
64  return;
65 }//ReadCellStat
66 
67 //-----------------------------------------------------------------------------------------
68 Int_t StFmsCalibMaker::CheckFmsTrigger(const StTriggerId& trigId, const int mFmsTrigIdBase)
69 {
70  int trigFired = 0;
71 
72  //Loop over RUN15 FMS triggers
73  for (int a=0; a<4; a++) //4 periods
74  for (int b=0; b<3; b++) //3 possible versions
75  for (int c=0; c<13; c++) //13 triggers: SmBS1,SmBS2,SmBS3, LgBS1,LgBS2,LgBS3, DiBS, JP2,JP1,JP0,DiJP, "",LED
76  {
77  int tempId = mFmsTrigIdBase + 10000*a + 20*b + 1+c;
78  if (trigId.isTrigger(tempId)) trigFired |= (1 << c);
79  }
80 
81  return trigFired;
82 }//CheckFmsTrigger
83 
84 //-------------------------------------------------------------
85 Int_t StFmsCalibMaker::ReadBbcSlewing(const char* filename_bbc) //Written by Oleg Eyser
86 {
87  mApplyBbcZvtx = true; //CKim
88 
89  // reading parameters for BBC slewing correction
90  char s[100];
91  int iew, ipmt;
92  float ca, cb, cc;
93 
94  FILE *pFile = fopen( filename_bbc, "read" );
95  fgets( s, 100, pFile );
96  for( int ew=0; ew<2; ew++ )
97  for( int p=0; p<16; p++ )
98  {
99  fscanf( pFile, " %d %d %f %f %f \n", &iew, &ipmt, &ca, &cb, &cc);
100  if ( ew==iew && p+1==ipmt )
101  {
102  mBbcSlew[ew][p][0] = ca;
103  mBbcSlew[ew][p][1] = cb;
104  mBbcSlew[ew][p][2] = cc;
105  }
106  else return kError;
107  }
108  fclose( pFile );
109 
110  cout << "BBC slewing: z(A+B/[C+adc])" << endl;
111  for( int ew=0; ew<2; ew++ )
112  {
113  if( ew==0 ) cout << " East" << endl;
114  if( ew==1 ) cout << " West" << endl;
115  for( int p=0; p<16; p++ )
116  {
117  cout << Form("PMT%2d - %7.2f %7.2f %7.2f ",
118  p+1, mBbcSlew[ew][p][0], mBbcSlew[ew][p][1], mBbcSlew[ew][p][2]) << endl;
119  }
120  }
121  cout <<endl;
122 
123  return kStOK;
124 }//ReadBbcSlewing
125 
126 //--------------------------------------------------------------------
127 Float_t StFmsCalibMaker::GetBbcZCorr(const StTriggerData* triggerData) //Written by Oleg Eyser, Modified by CKim
128 {
129  //DO NOT use muDST->event()->bbcTriggerDetector() -- obsolete!!!
130  Float_t bbcZ = -999.;
131  Float_t bbcTdiff = -999.;
132  UShort_t tdc1east, tdc1west;
133  UShort_t pmt1east, pmt1west;
134  UShort_t adc1east, adc1west;
135  unsigned int tdcMatchEast = 0;
136  unsigned int tdcMatchWest = 0;
137  bbcTdiff = (float)triggerData->bbcTimeDifference();
138  tdc1east = triggerData->bbcEarliestTDC(east);
139  tdc1west = triggerData->bbcEarliestTDC(west);
140 
141  //Compare TDC values to find earliest PMT (east/west)
142  for ( int i=1; i<=16; i++ )
143  {
144  if ( tdc1east==triggerData->bbcTDC(east, i) )
145  {
146  adc1east = triggerData->bbcADC(east, i);
147  pmt1east = i-1;
148  ++tdcMatchEast;
149  }
150  if ( tdc1west==triggerData->bbcTDC(west, i) )
151  {
152  adc1west = triggerData->bbcADC(west, i);
153  pmt1west = i-1;
154  ++tdcMatchWest;
155  }
156  }
157 
158  //BBC slewing correction (east/west)
159  if ( tdcMatchEast==1 && tdcMatchWest==1 )
160  {
161  Float_t zEast = -0.3 * ( bbcTdiff
162  - mBbcSlew[0][pmt1east][0]
163  - mBbcSlew[0][pmt1east][1]/(mBbcSlew[0][pmt1east][2] + adc1east) );
164  Float_t zWest = -0.3 * ( bbcTdiff
165  - mBbcSlew[1][pmt1west][0]
166  - mBbcSlew[1][pmt1west][1]/(mBbcSlew[1][pmt1west][2] + adc1west) );
167  bbcZ = (zEast + zWest)/2.0;
168  }
169 
170  return bbcZ;
171 }//GetBbcZCorr
172 
173 //--------------------------------------------------------------------------------------------
174 Float_t StFmsCalibMaker::GetBbcZCorrMass(StFmsPointPair* pair, Float_t bbcZ, bool returnOpenA)
175 {
176  const Float_t e0 = pair->point(0)->energy();
177  const Float_t e1 = pair->point(1)->energy();
178  const Float_t x0 = pair->point(0)->XYZ().x();
179  const Float_t x1 = pair->point(1)->XYZ().x();
180  const Float_t y0 = pair->point(0)->XYZ().y();
181  const Float_t y1 = pair->point(1)->XYZ().y();
182  const Float_t z0 = pair->point(0)->XYZ().z() - bbcZ;
183  const Float_t z1 = pair->point(1)->XYZ().z() - bbcZ;
184 
185  const Float_t dist = sqrt(pow(x0 - x1, 2) + pow(y0 - y1, 2) + pow(z0 - z1, 2));
186  const Float_t zAvg = (z0 + z1)/2;
187 
188  const Float_t corrOpenA = 2 * atan(dist / (2*zAvg));
189  const Float_t corrMass = sqrt(2 * e0 * e1 * (1 - cos(corrOpenA)));
190 
191  if (returnOpenA) return corrOpenA;
192  return corrMass;
193 }//GetBbcZCorrMass
194 
195 //---------------------------
196 Int_t StFmsCalibMaker::Init()
197 {
198  mFmsDbMk = static_cast<StFmsDbMaker*>(GetMaker("fmsDb"));
199  if (!mFmsDbMk)
200  {
201  LOG_ERROR <<"StFmsCalibMaker::InitRun - !StFmsDbMaker" <<endl;
202  return kStFatal;
203  }
204 
205  return kStOk;
206 }//Init
207 
208 //---------------------------------------
209 Int_t StFmsCalibMaker::InitRun(int runNo)
210 {
211  Info("InitRun", "Start run %i...", runNo);
212  mRunNo = runNo;
213 
214  mFile = new TFile(mOutName, "RECREATE");
215  mFile->SetCompressionLevel(9);
216  mFile->cd();
217 
218  //Masked channels xcheck, Get histograms
219  for (int a=0; a<4; a++)
220  {
221  const int detId = a+8;
222  const int maxCh = mFmsDbMk->maxChannel(detId);
223 
224  //Printout gainCorr/cellStat, and check if bad marked cells are masked out properly
225  for (int b=0; b<maxCh; b++)
226  {
227  const int ch = b+1;
228  const float gain = mFmsDbMk->getGain(detId, ch);
229  const float gainCorr = mFmsDbMk->getGainCorrection(detId, ch);
230  if (gain==0) continue; //Cells physically not exist
231 
232  const char* stat = "";
233  if (mCellStat[a][ch]==BAD) stat = "BAD";
234  else if (mCellStat[a][ch]==DEAD) stat = "DEAD";
235  cout <<Form("%2i %3i %4.3f %s", detId, ch, gainCorr, stat) <<endl;
236 
237  //Enforce stop if any bad marked cell alive (nonzero gainCorr)
238  if (mReadCellStat==true && mCellStat[a][ch]==BAD && gainCorr!=0.000)
239  {
240  cout <<Form("\nWARNING!!! Bad marked cell's gainCorr is alive: d%i ch%i\n", detId, ch) <<endl;
241  return kStStop;
242  }
243  }//b, ch (all)
244 
245  //Histograms (essential, to be used in calibration process)
246  mH2_mass[a] = new TH2F(Form("mass_d%i", detId), ";ch;mass", maxCh,0.5,maxCh+0.5, 50,0.,0.5);
247  mH2_mass[a]->Sumw2();
248  mH2_massFine[a] = new TH2F(Form("mass_d%i_fine", detId), ";ch;mass", maxCh,0.5,maxCh+0.5, 250,0.,0.5);
249  mH2_massFine[a]->Sumw2();
250  }//a, detId
251 
252  //Map will be used in calibFms.C: position/bit shift will be obatined from DB according to date
253  if (mGetMap)
254  {
255  ofstream out1, out2;
256  out1.open("FmsMapBase.txt");
257  out2.open("FmsMapBitShift.txt");
258  for (int a=0; a<4; a++)
259  {
260  const int detId = a+8;
261  const int maxCh = mFmsDbMk->maxChannel(detId);
262  for (int b=0; b<maxCh; b++)
263  {
264  const int ch = b+1;
265  const float gain = mFmsDbMk->getGain(detId, ch);
266  if (gain==0) continue; //Cells physically not exist
267 
268  const int bs = mFmsDbMk->getBitShiftGain(detId, ch);
269  const int col = mFmsDbMk->getColumnNumber(detId, ch);
270  const int row = mFmsDbMk->getRowNumber(detId, ch);
271  const float chX = mFmsDbMk->getStarXYZ(detId, ch).x();
272  const float chY = mFmsDbMk->getStarXYZ(detId, ch).y();
273 
274  out1 <<Form("%2i %3i %4.3f %2i %2i %6.2f %6.2f", detId, ch, gain, col, row, chX, chY) <<endl;
275  out2 <<Form("%2i %3i %2i", detId, ch, bs) <<endl;
276  }//b, ch
277  }//a, detId
278  out1.close();
279  out2.close();
280  }
281 
282  //QA items
283  if (mApplyBbcZvtx ||
284  mGetQaHist ||
285  mGetQaHistAdc ||
286  mGetQaTree) mQa = new StFmsCalibMakerQa();
287 
288  if (mApplyBbcZvtx) mQa->CreateQaHistZVtx();
289  for (int a=0; a<4; a++)
290  {
291  const int detId = a+8;
292  const int maxCh = mFmsDbMk->maxChannel(detId);
293  if (mGetQaHist) mQa->CreateQaHist(detId, maxCh);
294  if (mGetQaHistAdc)
295  {
296  mQa->CreateQaHistAdc(detId, maxCh, mTrigMB);
297  if (a==0) cout <<Form("\nWARNING! GetQaHistAdc() is used with trigger %i\n", mTrigMB) <<endl;
298  }
299  }
300  if (mGetQaTree) mQa->CreateQaTree();
301 
302  return kStOk;
303 }//InitRun
304 
305 //-----------------------------
307 {
308  mFile->Write();
309  mFile->Close();
310  return kStOK;
311 }//Finish
312 
313 //---------------------------
315 {
316  mEvent++;
317  if (mEvent%1000 == 0) cout <<Form("%5i processed...", mEvent) <<endl;
318  if (mGetQaHist) mQa->mH1_nEvents->Fill(mRunNo);
319 
320  StMuDst* muDST = (StMuDst*)GetInputDS("MuDst");
321  if (!muDST)
322  {
323  LOG_ERROR <<"StFmsCalibMaker::Make - !MuDst" <<endl;
324  return kStErr;
325  }
326  else
327  {
328  //Skip events in abort gap
329  mXing = muDST->event()->triggerData()->bunchId7Bit();
330  if ((mXing>=30 && mXing<40) || (mXing>=110 && mXing<120)) return kStSkip;
331 
332  //Check trigger
333  if (mGetQaHistAdc) //Check specified minBias trigger: only for ADC QA
334  {
335  const StTriggerId& trigId = muDST->event()->triggerIdCollection().nominal();
336  if (trigId.isTrigger(mTrigMB)) mQa->mH1_trig->Fill(mTrigMB);
337  else return kStSkip;
338  }
339  else //Check FMS trigger, skip invalid cases
340  {
341  mTrig = 0;
342  mTrig = CheckFmsTrigger(muDST->event()->triggerIdCollection().nominal());
343  if (mTrig==0)
344  {
345  cout <<"No FMS trigger fired! Skip event " <<mEvent <<endl;
346  return kStSkip;
347  }
348  for (int i=0; i<13; i++)
349  {
350  bool mTrigFire = false;
351  if (mTrig & (1<<i)) mTrigFire = true;
352  if (i==11 && mTrigFire==true) return kStSkip; //Empty bit
353  if (i==12 && mTrigFire==true) return kStSkip; //LED
354  }
355  }//Check trigger
356 
357  //Check VPD west timing: for RUN15 pAu/pAl, written by X. Chu
358  if (mApplyVpdTime)
359  {
360  const StTriggerData* triggerData = muDST->event()->triggerData();
361  if (!triggerData) { LOG_ERROR <<"StFmsCalibMaker::Make - !triggerData" <<endl; return kStErr; }
362  UShort_t vpdWestTdc = triggerData->vpdEarliestTDC(west);
363  if (vpdWestTdc > mVpdCut) return kStSkip;
364  }
365  }//Eventwise cut
366 
367  StEvent* event = (StEvent*)GetInputDS("StEvent");
368  if (!event)
369  {
370  LOG_ERROR <<"StFmsCalibMaker::Make - !StEvent" <<endl;
371  return kStErr;
372  }
373  else mFmsColl = (StFmsCollection*) event->fmsCollection();
374 
375  //-------------------------------------------
376 
377  //zVtx from BBC, with slewing correction by Oleg
378  if (mApplyBbcZvtx)
379  {
380  const StTriggerData* triggerData = muDST->event()->triggerData();
381 
382  mBbcZ = -999;
383  mBbcZ = GetBbcZCorr(triggerData);
384  if (mBbcZ == -999.) return kStSkip;
385  else mQa->mH1_bbcZ->Fill(mBbcZ);
386  }
387 
388  //QA: ADC by specific minBias trigger. WARNING: lines after this function will be skipped
389  if (mGetQaHistAdc)
390  {
391  StSPtrVecFmsHit& HITS = mFmsColl->hits();
392  const int nHITS = mFmsColl->numberOfHits();
393  for (int a=0; a<nHITS; a++)
394  {
395  const int detId = HITS[a]->detectorId();
396  const int ch = HITS[a]->channel();
397  if (detId<8 || detId>11) continue;
398 
399  const unsigned short adcRaw = HITS[a]->adc();
400  const unsigned short adcCor = mFmsDbMk->getCorrectedAdc(detId, ch, adcRaw);
401 
402  if (adcCor>3 && adcCor<250) mQa->mH2_adc[detId-8]->Fill(ch, adcCor); //Cut out pedestal tails & overflow
403  mQa->mH2_adcWide[detId-8]->Fill(ch, adcCor);
404  }//a, loop over hits
405 
406  return kStOk;
407  }//GetQaHistAdc
408 
409  //Fill pi0 mass vs. channels for calibration
410  //------------------------------------------
411 
412  vector<StFmsPointPair*>& PAIRS = mFmsColl->pointPairs();
413  const int nPAIRS = mFmsColl->numberOfPointPairs();
414  for (int a=0; a<nPAIRS; a++)
415  {
416  //Cut on a pair
417  StFmsPointPair* pair = PAIRS[a];
418  if (pair->energy() < 20.) continue;
419  if (pair->energy() > 40.) continue; //CUT1
420  if (pair->zgg() > 0.7) continue; //CUT2
421 
422  //Get zVtx corrected mass: if ReadBbcSlewing is NOT invoked default mass wo/ correction will be used
423  const float mass = (mApplyBbcZvtx)?GetBbcZCorrMass(pair, mBbcZ):pair->mass();
424  if (mass > 0.5) continue; //CUT3
425 
426  //Single point clusters only
427  if (pair->point(0)->nParentClusterPhotons() != 1 ||
428  pair->point(1)->nParentClusterPhotons() != 1) continue; //CUT4, SPC
429 
430  //Loop over point/cluster -> hit
431  bool massFilled = false;
432  for (int b=0; b<2; b++)
433  {
434  StFmsCluster* cluster = pair->point(b)->cluster();
435 
436  bool cutClu = true;
437  const float nTowers = cluster->nTowers();
438  const float sigMax = cluster->sigmaMax();
439  const float sigMin = cluster->sigmaMin();
440  if (nTowers < 2 || sigMax < 0.1 || sigMin < 0.01) cutClu = false;
441 
442  StPtrVecFmsHit* hits = &(cluster->hits());
443  const int nHits = hits->size();
444  for (int c=0; c<nHits; c++)
445  {
446  const int tempDet = hits->at(c)->detectorId();
447  const int tempCh = hits->at(c)->channel();
448  const float tempE = hits->at(c)->energy();
449  if (tempDet<8 || tempDet>11) continue;
450  if (tempDet>9 && cutClu==false) continue; //CUT5, Cluster quality, Only for small cells
451 
452  if (tempE/pair->energy() > 0.3) //CUT6
453  {
454  mH2_mass [tempDet-8]->Fill(tempCh, mass);
455  mH2_massFine[tempDet-8]->Fill(tempCh, mass);
456  massFilled = true;
457  }
458  }//c, Loop over hits
459  }//b, Loop over point/cluster
460 
461  //QA for zVtx effect evaluation
462  if (massFilled && mApplyBbcZvtx)
463  {
464  StLorentzVectorF v0 = pair->point(0)->fourMomentum();
465  StLorentzVectorF v1 = pair->point(1)->fourMomentum();
466  const float pointE0 = pair->point(0)->energy();
467  const float pointE1 = pair->point(1)->energy();
468  const float orig_openA = acos((v0.px()*v1.px() + v0.py()*v1.py() + v0.pz()*v1.pz()) / (pointE0*pointE1));
469  const float orig_mass = pair->mass();
470  const float corr_openA = GetBbcZCorrMass(pair, mBbcZ, true);
471  const float corr_mass = GetBbcZCorrMass(pair, mBbcZ);
472  mQa->mH1_diffOpenA->Fill(orig_openA - corr_openA);
473  mQa->mH1_diffMass ->Fill(orig_mass - corr_mass);
474  }
475  }//a, Loop over pairs
476 
477  //QA
478  //-------------------------------------------
479 
480  if (mGetQaHist==false && mGetQaTree==false) return kStOk;
481 
482  for (int a=0; a<nPAIRS; a++)
483  {
484  //Cut on a pair
485  StFmsPointPair* pair = PAIRS[a];
486  if (pair->energy() < 20.) continue; //CUT1: no upper energy limit
487  if (pair->zgg() > 0.7) continue; //CUT2
488 
489  //Get zVtx corrected openA and mass
490  const float openA = (mApplyBbcZvtx)?GetBbcZCorrMass(pair, mBbcZ, true):GetBbcZCorrMass(pair, 0, true);
491  const float mass = (mApplyBbcZvtx)?GetBbcZCorrMass(pair, mBbcZ):pair->mass();
492  if (mass > 1.0) continue; //CUT3: extended from 0.5 -> 1.0
493 
494  //Single point clusters only
495  if (pair->point(0)->nParentClusterPhotons() != 1 ||
496  pair->point(1)->nParentClusterPhotons() != 1) continue; //CUT4, SPC
497 
498  //Loop over point -> cluster -> hit
499  const float pairE = pair->energy();
500  bool fillQaTree = false;
501  for (int b=0; b<2; b++)
502  {
503  const float pointX = pair->point(b)->XYZ().x();
504  const float pointY = pair->point(b)->XYZ().y();
505  StLorentzVectorF vecF = pair->point(b)->fourMomentum();
506  StFmsCluster* cluster = pair->point(b)->cluster();
507 
508  bool cutClu = true;
509  const float nTowers = cluster->nTowers();
510  const float sigMax = cluster->sigmaMax();
511  const float sigMin = cluster->sigmaMin();
512  if (nTowers < 2 || sigMax < 0.1 || sigMin < 0.01) cutClu = false;
513 
514  StPtrVecFmsHit* hits = &(cluster->hits());
515  const int nHits = hits->size();
516  for (int c=0; c<nHits; c++)
517  {
518  const int tempDet = hits->at(c)->detectorId();
519  const int tempCh = hits->at(c)->channel();
520  const float tempE = hits->at(c)->energy();
521  if (tempDet<8 || tempDet>11) continue;
522 
523  //-------------------------------
524 
525  if (mGetQaTree) //WARNING: cluster quality cut is NOT applied here
526  {
527  if (tempE/pairE > 0.3) fillQaTree = true;
528 
529  const int nHit = mQa->mNhit;
530  if (nHit > mQa->mNhitMax) LOG_ERROR <<"WARNING! nhit exceeds allowed limit!" <<endl;
531  mQa->mDetId [nHit] = tempDet;
532  mQa->mCh [nHit] = tempCh;
533  mQa->mPointB[nHit] = b;
534  mQa->mHitE [nHit] = tempE;
535  mQa->mNhit++;
536  }//mGetQaTree, hit
537 
538  //-------------------------------
539 
540  if (mGetQaHist)
541  {
542  if (tempDet>9 && cutClu==false) continue; //CUT5, Cluster quality, Only to small cells
543 
544  int iZgg = -1;
545  for (int i=0; i<7; i++) { if (pair->zgg() > 0.1*i && pair->zgg() < 0.1*(i+1)) iZgg = i; }
546 
547  int iPairE = -1;
548  for (int i=0; i<7; i++)
549  {
550  if (pairE > 20+10*i && pairE < 20+10*(i+1)) iPairE = i;
551  if (pairE > 80) iPairE = 6;
552  }
553 
554  //PointXY, Same condition to default mass vs. ch
555  if (pairE<40 && mass<0.5 && tempE/pairE>0.3)
556  {
557  mQa->mH2_pointsEP[tempDet-8]->Fill(vecF.pseudoRapidity(), vecF.phi());
558  mQa->mH2_pointsXY[b][0]->Fill(pointX, pointY);
559  if (tempDet<=9) mQa->mH2_pointsXY[b][1]->Fill(pointX, pointY);
560  else mQa->mH2_pointsXY[b][2]->Fill(pointX, pointY);
561  }
562 
563  //Mass, default condition except range is wider
564  if (pairE<40 && tempE/pairE>0.3)
565  {
566  mQa->mH2_massWide[tempDet-8]->Fill(tempCh, mass);
567  mQa->mH2_massOpenA[tempDet-8][iZgg]->Fill(openA, mass);
568  }
569 
570  //Scan pairE or Zgg
571  if (tempE/pairE>0.3)
572  {
573  mQa->mH2_massPairE[tempDet-8][iZgg]->Fill(pairE, mass);
574  mQa->mH2_massZgg[tempDet-8][iPairE]->Fill(pair->zgg(), mass);
575  }
576  }//mGetQaHist
577  }//c, Loop over hits, 2nd for QA, histograms/tree
578 
579  if (mGetQaTree)
580  {
581  mQa->mCluTowers[b] = cluster->nTowers();
582  mQa->mCluMax[b] = cluster->sigmaMax();
583  mQa->mCluMin[b] = cluster->sigmaMin();
584  mQa->mCluX[b] = cluster->x();
585  mQa->mCluY[b] = cluster->y();
586 
587  mQa->mPointE[b] = pair->point(b)->energy();
588  mQa->mPointX[b] = pair->point(b)->XYZ().x();
589  mQa->mPointY[b] = pair->point(b)->XYZ().y();
590  }//mGetQaTree, cluster/point
591 
592  }//b, Loop over point/cluster, 2nd for QA
593 
594  if (mGetQaTree && fillQaTree && mQa->mNhit>0)
595  {
596  mQa->mMass = mass;
597  mQa->mOpenA = (mApplyBbcZvtx)?GetBbcZCorrMass(pair, mBbcZ, true):GetBbcZCorrMass(pair, 0, true);
598  mQa->mZgg = pair->zgg();
599  mQa->mTrigBit = mTrig;
600 
601  mQa->T->Fill();
602  }
603  mQa->ResetQaTree();
604 
605  }//a, Loop over pairs, 2nd for QA
606 
607  return kStOk;
608 }//Make
Definition: Stypes.h:49
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:40
Definition: Stypes.h:51
Definition: Stypes.h:44
Definition: Stypes.h:41