StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPeCTrigger.cxx
1 //
3 // $Id: StPeCTrigger.cxx,v 1.23 2016/02/24 17:13:09 ramdebbe Exp $
4 // $Log: StPeCTrigger.cxx,v $
5 // Revision 1.23 2016/02/24 17:13:09 ramdebbe
6 // started implementing 2016 UPC triggers, not complete
7 //
8 // Revision 1.22 2015/09/15 15:58:14 ramdebbe
9 // added 2E trigger
10 //
11 // Revision 1.21 2015/08/29 00:02:43 perev
12 // Account non trigger events
13 //
14 // Revision 1.20 2015/07/22 18:47:22 ramdebbe
15 // added trigger for pA part of run 15
16 //
17 // Revision 1.19 2015/03/11 17:21:44 ramdebbe
18 // added run 15 RP triggers (only to MuDst filled method needs to be copied to StEvent filled method
19 //
20 // Revision 1.18 2015/02/25 01:18:22 ramdebbe
21 // added trigger information for Roman Pot triggers 2015 pp200GeV
22 //
23 // Revision 1.17 2014/06/18 19:01:42 ramdebbe
24 // reset trg_... for every event
25 //
26 // Revision 1.16 2014/06/18 16:27:55 ramdebbe
27 // added zerobias as another trigger of interest
28 //
29 // Revision 1.15 2014/04/25 20:00:06 ramdebbe
30 // added more triggers for run14
31 //
32 // Revision 1.14 2013/12/27 20:47:28 ramdebbe
33 // added a set method to select a trigger
34 //
35 // Revision 1.13 2013/10/28 14:18:16 ramdebbe
36 // added arrays to handle bbc and zdc information
37 //
38 // Revision 1.12 2013/01/24 15:44:59 ramdebbe
39 // added ZDC shower max information to output tree and bbc small tubes individual ADC. Returns UPC_Main trigger
40 //
41 // Revision 1.11 2012/06/26 18:29:29 ramdebbe
42 // previous entry did not include actual changes
43 //
44 // Revision 1.10 2012/06/13 15:43:15 ramdebbe
45 // topo and main triggers for different run periods
46 //
47 // Revision 1.9 2007/04/28 17:56:35 perev
48 // Redundant StChain.h removed
49 //
50 // Revision 1.8 2003/11/25 01:54:37 meissner
51 // correct several bugs: eta cut for tracks, charge sorting, add counting of FTPC and TPC primary tracks, Add bbc information
52 //
53 // Revision 1.7 2003/09/02 17:58:46 perev
54 // gcc 3.2 updates + WarnOff
55 //
56 // Revision 1.6 2002/12/16 23:04:02 yepes
57 // Field comes in KGauss and should be passed to routines in Teslas
58 // problem pointed out by Vladimir
59 //
60 // Revision 1.5 2002/03/19 22:23:52 meissner
61 // New variables: zdc unatt., Trigger word, MC tree if Geant Branch, DCA for primary pairs, all tracks for secondary pairs (Test)
62 //
63 // add un attenuated zdc;s
64 // Revision 1.4 2001/04/25 18:12:05 perev
65 // HPcorrs
66 //
67 // Revision 1.3 2001/02/21 20:54:25 yepes
68 // *** empty log message ***
69 //
70 // Revision 1.0 2000/12/11
71 //
73 #include <Stiostream.h>
74 #include "StPeCTrigger.h"
75 #include "StPeCMaker.h"
76 #include "StEventTypes.h"
77 #include "Stypes.h"
78 #include "StMessMgr.h"
79 #include "StPeCCtbSlat.h"
80 //#include <math.h> /* pow */
81 
82 
83 ClassImp(StPeCTrigger)
84 
86 //
87 // Set y2k L0
88 //
89  l0_2000 = new StPeCL0 ();
90  l0_2000->setYear1Input ();
91  l0_2000->setP4SLuts ();
92 //
93 // Set y2k corrected L0
94 //
95  l0_2000Corrected = new StPeCL0 ();
96  l0_2000Corrected->setYear1Input ();
97  l0_2000Corrected->setP4PLuts ();
98 //
99 // Set y2k+1 L0
100 //
101  l0Offline2001 = new StPeCL0 ();
102  l0Offline2001->setYear2Input ();
103  l0Offline2001->setCountingLuts ();
104 //
105  ctbSlats = new TClonesArray ("StPeCCtbSlat", 10);
106 
107 
108 }
109 StPeCTrigger::~StPeCTrigger() {
110  ctbSlats->Clear();
111  delete ctbSlats ;
112 }
113 
114 void StPeCTrigger::clear() {
115  ctbSlats->Clear();
116 }
117 
118 Int_t StPeCTrigger::process(StEvent *event, string triggerSel)
119 {
120  unsigned int i,j;
121 
122  //make sure trg_2001 is reset before possible use
123 
124  trg_2001 = 0;
125  trg_3001 = 0;
126  trg_3000 = 0;
127  trg_2004 = 0;
128 
129  const StTriggerId * ttid;
130  // get trigger word
131  tw = event->l0Trigger()->triggerWord();
132  runN = event->runId();
133  LOG_INFO << "StPeCTrigger::reading StEvent ---------- " << endm;
134  l0_2000->setInfoLevel ( infoLevel );
135 
136 
137 // StL0Trigger* l0Data = event->l0Trigger();
138 
139 
140  // read trigger information with up to date methods
141  //
142  const StTriggerData * trigData = event->triggerData();
143  if(!trigData) {
144  LOG_ERROR << "StTriggerData not available "<< endm;
145  }
146  nBtofTriggerHits = trigData->tofMultiplicity();
147  nBTOFhits = event->btofCollection()->tofHits().size();
148  bunchId = trigData->bunchId7Bit();
149  lastDSM0 = trigData->lastDSM(0);
150  lastDSM1 = trigData->lastDSM(1);
151  StTriggerIdCollection* triggerIdColl = event->triggerIdCollection();
152  if(triggerIdColl) {
153  ttid= triggerIdColl->nominal();
154 
155 // LOG_INFO << "StPeCTrigger::trigger ID ----max------ " <<ttid->maxTriggerIds() << endm;
156 
157 // for(int it=0;it<ttid->maxTriggerIds();it++){
158 // LOG_INFO << "StPeCTrigger::trigger ID ---------- " <<ttid->triggerId(it) << endm;
159 // }
160 // if(ttid->isTrigger(260002)) {
161 // cout << "Got IDS ------ ZDC_Monitor ------------------------------------------------------ " <<endl;
162 // }
163 // LOG_INFO << "StPeCTrigger::process run number ---------- " <<runN << endm;
164  if(runN>11011035 && runN<= 11039028) trg_3000 =ttid->isTrigger(1); //run10 UPC Main unofficial
165  if(runN>11011035 && runN<= 11039028) trg_3001 =ttid->isTrigger(11); //run10 UPC Topo not present
166  if(runN>11039028 && runN<= 11077018) trg_3000 =ttid->isTrigger(260023); //run10 UPC Main official 260750
167  if(runN>11050046 && runN<= 11077018) trg_3001 =ttid->isTrigger(1); //run10 UPC Topo was never official
168 
169  if(runN>12130030 && runN<= 12146002) trg_3000 =ttid->isTrigger(4); //run11 UPC Main unofficial
170  if(runN>12130030 && runN<= 12179050) trg_3001 =ttid->isTrigger(11); //run11 UPC Topo was never official
171  if(runN>12146002 && runN<= 12152016) trg_3000 =ttid->isTrigger(350007); //run11 UPC Main official
172  if(runN>12152016 && runN<= 12179050) trg_3000 =ttid->isTrigger(350017); //run11 UPC Main official
173 
174  if(runN>13116029 && runN<= 13116046) trg_3000 =ttid->isTrigger(1); //run12 UU UPC Main unofficial
175  if(runN>13110010 && runN<= 13116042) trg_3001 =ttid->isTrigger(2); //run12 UU UPC Topo
176  if(runN>13121046 && runN<= 13125024) trg_3001 =ttid->isTrigger(1); //run12 UU UPC Topo
177  if(runN>13125024 && runN<= 13130033) trg_3001 =ttid->isTrigger(400604); //run12 UU UPC Topo
178  if(runN>13131006 && runN<= 13136015) trg_3001 =ttid->isTrigger(400614); //run12 UU UPC Topo
179  if(runN>13116047 && runN<= 13117027) trg_3000 =ttid->isTrigger(400601); //run12 UU UPC Main official
180  if(runN>13117027 && runN<= 13117036) trg_3000 =ttid->isTrigger(400611); //run12 UU UPC Main official
181  if(runN>13117036 && runN<= 13118017) trg_3000 =ttid->isTrigger(400621); //run12 UU UPC Main official
182  if(runN>13118017 && runN<= 13130033) trg_3000 =ttid->isTrigger(400631); //run12 UU UPC Main official
183  if(runN>13131006 && runN<= 13136015) trg_3000 =ttid->isTrigger(400641); //run12 UU UPC Main official
184 
185  if(runN>15001001 && runN<= 15070001) trg_3000 =ttid->isTrigger(8); //run14 low energy UPC_cosmic
186 
187 // trg_3000 =ttid->isTrigger(1);
188 // trg_3001 =0; //ttid->isTrigger(11); //run11 from 011035 to 039028 no topo trigger //use in firstList.list
189 // trg_3000 =ttid->isTrigger(260750);
190 // trg_3001 =0; //ttid->isTrigger(11); //run11 from 011035 to 039028 no topo trigger used in secondList.list
191 // trg_3000 =ttid->isTrigger(400631); //run12 UU
192 // trg_3001 =ttid->isTrigger(400604); //run12 UU starting from 13125025 to end. Used in thirdList.list and fourth list (out of 4 lists)
193 // trg_3000 =ttid->isTrigger(410601); //run12 cuAu
194 // trg_3001 =ttid->isTrigger(410604); //run12 cuAu starting from 13139056 to end.
195  }
196  StTriggerDetectorCollection* trg = event->triggerDetectorCollection();
197  if ( !trg ) {
198  printf ( "StPeCTrigger::StPeCTrigger: No trigger information \n" ) ;
199  return 1 ;
200  }
201  StCtbTriggerDetector& ctb = trg->ctb();
202  StMwcTriggerDetector& mwc = trg->mwc();
203  StZdcTriggerDetector& zdc = trg->zdc();
204  StBbcTriggerDetector& bbc = trg->bbc();
205 // StEmcTriggerDetector& emc = trg->emc();
206 
207 
208 // if ( l0Data && infoLevel > 0 ){
209 // cout << "L0 mwcCtbMultiplicity = " << l0Data->mwcCtbMultiplicity() << endl;
210 // }
211  if(&zdc){
212  if ( infoLevel > 10 ) {
213  cout << "ZDC sum " << zdc.adcSum() << endl;
214  cout << "ZDC sum west " << zdc.adcSum(west) << endl;
215  cout << "ZDC sum east " << zdc.adcSum(east) << endl;
216  }
217  // attenuated signals
218  zdcWest = zdc.adcSum(west) ;
219  zdcEast = zdc.adcSum(east) ;
220  zdcSum = zdc.adcSum() ;
221  // unattenuated // see StZdcTriggerDetector documentation
222  zdcWestUA = zdc.adc(0) ;
223  zdcEastUA = zdc.adc(4) ;
224  zdcSumUA = zdcEastUA+zdcWestUA ;
225  int hori = 1;
226  int vert = 0;
227  //SMD information
228  for(int i=0;i<8;i++){
229  zdcSMDEastH[i] = trigData->zdcSMD(east, hori, i+1);
230  zdcSMDEastV[i] = trigData->zdcSMD(east, vert, i+1);
231  zdcSMDWestH[i] = trigData->zdcSMD(west, hori, i+1);
232  zdcSMDWestV[i] = trigData->zdcSMD(west, vert, i+1);
233  }
234 
235  }
236  else {
237  zdcWestUA = 0 ;
238  zdcEastUA = 0 ;
239  zdcSumUA = 0 ;
240 
241  zdcWest = 0 ;
242  zdcEast = 0 ;
243  zdcSum = 0 ;
244 
245  for(int i=0;i<8;i++){
246  zdcSMDEastH[i] = 0;
247  zdcSMDEastV[i] = 0;
248  zdcSMDWestH[i] = 0;
249  zdcSMDWestV[i] = 0;
250  }
251  }
252 
253 //
254 // MWC
255 //
256  float mwcsum = 0.0;
257 
258  float mwcThres = 2. ;
259  nMwcHits = 0 ;
260  mwcSW = 0 ;
261  mwcNW = 0 ;
262  mwcTW = 0 ;
263  mwcBW = 0 ;
264  mwcSE = 0 ;
265  mwcNE = 0 ;
266  mwcTE = 0 ;
267  mwcBE = 0 ;
268  if(&mwc){
269  for(i=0; i<mwc.numberOfSectors(); i++){
270  for(j=0; j<mwc.numberOfSubSectors(); j++){
271  mwcsum += mwc.mips(i,j,0);
272  if ( mwc.mips(i,j,0) > mwcThres ) {
273  nMwcHits++ ;
274  if ( i == 1 || i == 2 || i == 3 ) mwcSW++ ;
275  else if ( i == 4 || i == 5 || i == 6 ) mwcBW++ ;
276  else if ( i == 7 || i == 8 || i == 9 ) mwcNW++ ;
277  else if ( i == 10 || i == 11 || i == 0 ) mwcTW++ ;
278  else if ( i == 13 || i == 14 || i == 15 ) mwcNE++ ;
279  else if ( i == 16 || i == 17 || i == 18 ) mwcBE++ ;
280  else if ( i == 19 || i == 20 || i == 21 ) mwcSE++ ;
281  else if ( i == 22 || i == 23 || i == 12 ) mwcTE++ ;
282  }
283  }
284  }
285  if ( infoLevel > 1 )
286  cout << "mwc mips " << mwcsum << endl;
287  }
288 //
289 // CTB
290 //
291  float ctbsum=0.0;
292  ctbSW = 0 ;
293  ctbNW = 0 ;
294  ctbTW = 0 ;
295  ctbBW = 0 ;
296  ctbSE = 0 ;
297  ctbNE = 0 ;
298  ctbTE = 0 ;
299  ctbBE = 0 ;
300  nCtbHits = 0 ;
301  float ctbThres = 2. ;
302  if(&ctb){
303  TClonesArray &pCtbSlats = *ctbSlats;
304  for(i=0; i<120; i++){
305  for(j=0; j<2; j++){
306  ctbsum += ctb.mips(i,j,0);
307  if ( ctb.mips(i,j,0) > 0 ) {
308  Byte_t i_eta = (Byte_t)(j+1);
309  Byte_t i_phi = (Byte_t)(i+1);
310  Int_t adc = (Int_t)ctb.mips(i,j,0) ;
311  new(pCtbSlats[nCtbHits++]) StPeCCtbSlat(i_phi,i_eta,adc) ;
312  }
313 
314  if ( ctb.mips(i,j,0) > ctbThres ) {
315  if ( i >= 5 && i < 20 ) ctbSW++ ;
316  else if ( i >= 20 && i < 35 ) ctbBW++ ;
317  else if ( i >= 35 && i < 50 ) ctbNW++ ;
318  else if ( i >= 50 && i < 60 ) ctbTW++ ;
319  else if ( i < 5 ) ctbTW++ ;
320  else if ( i >= 65 && i < 80 ) ctbNE++ ;
321  else if ( i >= 80 && i < 95 ) ctbBE++ ;
322  else if ( i >= 95 && i < 110 ) ctbSE++ ;
323  else if ( i >= 110 ) ctbTE++ ;
324  else if ( i >= 60 && i < 65 ) ctbTE++ ;
325  }
326  }
327  }
328  if ( infoLevel > 10 )
329  cout << "CTB MIP total sum = " << ctbsum << endl;
330  }
331  ctbSum = ctbsum ;
332  mwcSum = mwcsum ;
333 
334 
335 
336  // BBC
337  if(&bbc){
338 
339  if ( infoLevel > 10 ) {
340  cout << "BBC East adc[0] = " << bbc.adc(8) << endl;
341  bbc.dump();
342  }
343 
344  // bbcAdcSumEastSm=bbc.adcSumEast();
345  bbcAdcSumEastSm=bbc.adc(8);
346  bbcAdcSumWestSm=bbc.adcSumWest();
347  bbcAdcSumEastLg=bbc.adcSumEastLarge();;
348  bbcAdcSumWestLg=bbc.adcSumWestLarge();;
349 
350  bbcNHitEastSm=bbc.nHitEast();
351  bbcNHitWestSm=bbc.nHitWest();
352 
353  bbcNHitEastLg=bbc.nHitEastLarge();;
354  bbcNHitWestLg=bbc.nHitWestLarge();;
355 
356 // bbcTacEast=bbc.tdcEarliestEast();
357 // bbcTacWest=bbc.tdcEarliestWest();
358 // cout<<"just before using triData "<<endl;
359  if(trigData){
360  bbcTacEast = trigData->bbcEarliestTDC(east);
361  bbcTacWest = trigData->bbcEarliestTDC(west);
362  bbcTimeDiff = trigData->bbcTimeDifference();
363  for(int i=0;i<36;i++){
364  bbcTDCEast[i] = trigData->bbcTDC(east, i+1);
365  bbcTDCWest[i] = trigData->bbcTDC(west, i+1);
366  bbcADCEast[i] = trigData->bbcADC(east, i+1);
367  bbcADCWest[i] = trigData->bbcADC(west, i+1);
368  }
369  }
370 // cout<<"after use trigData"<<endl;
371 
372  } else {
373  bbcAdcSumEastSm=0;
374  bbcAdcSumWestSm=0;
375  bbcAdcSumEastLg=0;
376  bbcAdcSumWestLg=0;
377 
378  bbcNHitEastSm=0;
379  bbcNHitWestSm=0;
380  bbcNHitEastLg=0;
381  bbcNHitWestLg=0;
382 
383  bbcTacEast=0;
384  bbcTacWest=0;
385 
386  for(int i=0;i<36;i++){
387  bbcTDCEast[i] = 0;
388  bbcTDCWest[i] = 0;
389  }
390  }
391 // if(ttid->isTrigger(260002)){
392 // LOG_INFO << "StPeCTrigger::BBC West East ---------- " <<bbcAdcSumWestSm<<" -- "<<bbcAdcSumWestLg<<" --- "<< bbcAdcSumEastSm<<" -- "<<bbcAdcSumEastLg<< endm;
393 // }
394 //
395 // Simulate l0
396 //
397  p4 = l0_2000->process ( event ) ;
398  p4c = l0_2000Corrected->process ( event ) ;
399  p5 = l0Offline2001->process ( event ) ;
400 //
401 // Take quadrants from 2001 wiring
402 //
403  // L0 simulator
404  Bool_t trgOut[40];
405  {for ( int i = 0 ; i < 40 ; i++ ) trgOut[i] = 0 ;}
406 
407  if ( infoLevel > 20 ) {
408  printf ( "trgBits : " ) ;
409  for ( int i = 0 ; i < 24 ; i++ ) {
410  printf ( "%d ", trgOut[i] ) ;
411  }
412  printf ( "\n" ) ;
413  }
414  //
415  // EMC
416  //
417  //cout<<" StPeCTrigger ++++++++++++ number of towers +++++++ "<<emc.numberOfTowers()<<endl;
418 //
419 // Get Ftpc info
420 //
421  StFtpcHitCollection* ftpHitC = 0 ;
424 
425  ftpW = 0 ;
426  ftpE = 0 ;
427 
428  ftpHitC = event->ftpcHitCollection();
429  int nFtpcPlanes = 20 ;
430  if ( ftpHitC ) {
431  printf ( "there is a hit collection \n" ) ;
432  for ( int iPlane = 0 ; iPlane < nFtpcPlanes ; iPlane++ ) {
433  plane = 0 ;
434  plane = ftpHitC->plane(iPlane);
435  if ( !plane ) continue ;
436  for ( int iSector = 0 ; iSector < 6 ; iSector++ ) {
437  sector = 0 ;
438  sector = plane->sector(iSector);
439  if ( !sector ) continue ;
440  StSPtrVecFtpcHit& hits = sector->hits();
441  for ( unsigned int iHit = 0 ; iHit < hits.size() ; iHit++ ) {
442 // printf ( "plane %d sector %d x y z %f %f %f \n", iPlane, iSector,
443 // hits[iHit]->position().x(), hits[iHit]->position().y(), hits[iHit]->position().z()) ;
444  if ( iPlane < 10 ) ftpW++ ;
445  else ftpE++ ;
446 
447  }
448  }
449  }
450 
451  }
452 
453  return trg_3000 ;
454 }
455 
456 
457 Int_t StPeCTrigger::process(StMuDst* mudst, string triggerSel)
458 {
459  unsigned int i,j;
460  //make sure trg_2001 is reset before possible use
461 
462  trg_2001 = 0;
463  trg_3001 = 0;
464  trg_3000 = 0;
465  trg_2004 = 0;
466 
467  // get trigger word
468  tw = mudst->event()->l0Trigger().triggerWord();
469  LOG_INFO << "StPeCTrigger::reading StMuDst ---------- " << endm;
470  // read trigger information with up to date methods
471  //
472  double zdcRate = mudst->event()->runInfo().zdcCoincidenceRate();
473  const StTriggerData * trigData;
474  trigData = const_cast< StTriggerData *> (mudst->event()->triggerData());
475 
476  if(!trigData) {
477  LOG_ERROR << "StTriggerData not available in StMuDst "<< endm;
478  return 0 ; // this will reject the event
479  }
480  lastDSM0 = trigData->lastDSM(0);
481  lastDSM1 = trigData->lastDSM(1);
482  // get run number
483  //
484 
485  runN = mudst->event()->eventInfo().runId();
486  LOG_INFO << "StPeCTrigger Run ID: " << runN << endm;
487 
488  // get triggger ids
489  vector<unsigned int> triggerIds;
490  StMuTriggerIdCollection tt=mudst->event()->triggerIdCollection();
491 
492  StTriggerId ttid;
493  if(&tt) {
494  ttid= tt.nominal();
495  if(&ttid) {
496 
497  triggerIds= ttid.triggerIds();
498  std::vector<unsigned int>::iterator iiter;
499  // for(iiter=triggerIds.begin(); iiter!=triggerIds.end(); iiter++) {
500  // }
501  if(triggerSel=="ZDC_Monitor"){
502  trg_3000 =ttid.isTrigger(260022); //ZDC_monitor run10 this two lines are used for trigger efficiency study
503  trg_3001 =ttid.isTrigger(260750); //UPC_Main run10
504  // LOG_INFO << "StPeCTrigger::value of trg_3000 ZDC_monitor ---------- " <<trg_3000<< endm;
505  // LOG_INFO << "StPeCTrigger::value of trg_3001 UPC_Main ---------- " <<trg_3001<< endm;
506  }
507  if(triggerSel=="zerobias"){
508  trg_3000 =ttid.isTrigger(9300); //zerobias run10 this two lines are used for trigger efficiency study
509  trg_3001 =ttid.isTrigger(260750); //UPC_Main run10
510  LOG_INFO << "StPeCTrigger::value of trg_3000 zerobias ---------- " <<trg_3000<< endm;
511  LOG_INFO << "StPeCTrigger::value of trg_3001 UPC_Main ---------- " <<trg_3001<< endm;
512  }
513  if(triggerSel=="UPC_Main"){
514  if(runN>11011035 && runN<= 11039028) trg_3000 =ttid.isTrigger(1); //run10 UPC Main unofficial
515  if(runN>11011035 && runN<= 11039028) trg_3001 =ttid.isTrigger(11); //run10 UPC Topo not present
516  if(runN>11039028 && runN<= 11077018) trg_3000 =ttid.isTrigger(260750); //run10 UPC Main official 260750
517  if(runN>11050046 && runN<= 11077018) trg_3001 =ttid.isTrigger(1); //run10 UPC Topo was never official
518 
519  if(runN>12130030 && runN<= 12146002) trg_3000 =ttid.isTrigger(4); //run11 UPC Main unofficial
520  if(runN>12130030 && runN<= 12179050) trg_3001 =ttid.isTrigger(11); //run11 UPC Topo was never official
521  if(runN>12146002 && runN<= 12152016) trg_3000 =ttid.isTrigger(350007); //run11 UPC Main official
522  if(runN>12152016 && runN<= 12179050) trg_3000 =ttid.isTrigger(350017); //run11 UPC Main official
523 
524  if(runN>13116029 && runN<= 13116046) trg_3000 =ttid.isTrigger(1); //run12 UU UPC Main unofficial
525  if(runN>13110010 && runN<= 13116042) trg_3001 =ttid.isTrigger(2); //run12 UU UPC Topo
526  if(runN>13121046 && runN<= 13125024) trg_3001 =ttid.isTrigger(1); //run12 UU UPC Topo
527  if(runN>13125024 && runN<= 13130033) trg_3001 =ttid.isTrigger(400604); //run12 UU UPC Topo
528  if(runN>13131006 && runN<= 13136015) trg_3001 =ttid.isTrigger(400614); //run12 UU UPC Topo
529  if(runN>13116047 && runN<= 13117027) trg_3000 =ttid.isTrigger(400601); //run12 UU UPC Main official
530  if(runN>13117027 && runN<= 13117036) trg_3000 =ttid.isTrigger(400611); //run12 UU UPC Main official
531  if(runN>13117036 && runN<= 13118017) trg_3000 =ttid.isTrigger(400621); //run12 UU UPC Main official
532  if(runN>13118017 && runN<= 13130033) trg_3000 =ttid.isTrigger(400631); //run12 UU UPC Main official
533  if(runN>13131006 && runN<= 13136015) trg_3000 =ttid.isTrigger(400641); //run12 UU UPC Main official
534 
535 
536 
537  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_Main ---------- " <<trg_3000<< endm;
538  LOG_INFO << "StPeCTrigger::value of trg_3001 UPC_Topo ---------- " <<trg_3001<< endm;
539 
540  }
541  if(runN>15001001 && runN<= 15070001){
542 
543  trg_3000 =ttid.isTrigger(8); //run14 low energy UPC_cosmic
544  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_cosmic ------------------------------------ " <<trg_3000<< endm;
545  }
546 
547  if(runN>15077068 && runN<= 15170001){
548  if(triggerSel=="UPC_Main"){
549 
550  trg_3000 =ttid.isTrigger(11); //run14 200 GeV UPC_Main in preparation
551  trg_3001 =ttid.isTrigger(14); //run14 UPC_topo
552  trg_2001 =ttid.isTrigger(24); //run14 UPC_jpsiA i
553  trg_2004 =ttid.isTrigger(25); //run14 UPC_jpsiC
554  if(runN>15079024){
555  trg_3000 =ttid.isTrigger(450701); //run14 200 GeV UPC_Main elevated to physics
556  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_Main ------------------------------------ " <<trg_3000<< endm;
557  trg_3001 =ttid.isTrigger(450713); //run14 UPC_highG
558  trg_2001 =ttid.isTrigger(450717); //run14 UPC_main-p
559  trg_2004 =ttid.isTrigger(450702); //run14 UPC_topo
560  }
561  }
562  if(triggerSel=="UPC_Main-p"){
563 
564  trg_3000 =ttid.isTrigger(450717); //run14 200 GeV UPC_Main-p
565  trg_3001 =ttid.isTrigger(450701); //run14 UPC_Main
566  trg_2001 =ttid.isTrigger(450713); //run14 UPC_highG
567  trg_2004 =ttid.isTrigger(450705); //run14 UPC_jpsiB
568  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_topo ------------------------------------ " <<trg_3000<< endm;
569  }
570  if(triggerSel=="UPC_highG"){
571 
572  trg_3000 =ttid.isTrigger(450713); //run14 200 GeV UPC_highG
573  trg_3001 =ttid.isTrigger(450701); //run14 UPC_Main unprotected
574  trg_2001 =ttid.isTrigger(450702); //run14 UPC_topo
575  trg_2004 =ttid.isTrigger(450705); //run14 UPC_jpsiB
576  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_jpsiA ------------------------------------ " <<trg_3000<< endm;
577  }
578  if(triggerSel=="UPC_topo"){
579 
580  trg_3000 =ttid.isTrigger(450702); //run14 200 GeV UPC_topo in preparation
581  trg_3001 =ttid.isTrigger(450701); //run14 UPC_Main
582  trg_2001 =ttid.isTrigger(450713); //run14 UPC_highG
583  trg_2004 =ttid.isTrigger(450705); //run14 UPC_jpsiB
584  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_topo ------------------------------------ " <<trg_3000<< endm;
585  }
586  if(triggerSel=="UPC_jpsiC"){
587 
588  trg_3000 =ttid.isTrigger(25); //run14 200 GeV UPC_jpsiC in preparation
589  trg_3001 =ttid.isTrigger(11); //run14 UPC_Main
590  trg_2001 =ttid.isTrigger(24); //run14 UPC_jpsiA i
591  trg_2004 =ttid.isTrigger(14); //run14 UPC_topo
592  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_jpsiC ------------------------------------ " <<trg_3000<< endm;
593  }
594  if(triggerSel=="UPC_jpsiB"){
595 
596  trg_3000 =ttid.isTrigger(450705); //run14 200 GeV UPC_jpsiB in preparation
597  trg_3001 =ttid.isTrigger(450701); //run14 UPC_Main
598  trg_2001 =ttid.isTrigger(450713); //run14 UPC_highG
599  trg_2004 =ttid.isTrigger(450702); //run14 UPC_topo
600  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_jpsiB ------------------------------------ " <<trg_3000<< endm;
601  }
602  if(triggerSel=="UPC_jpsiA"){
603 
604  trg_3000 =ttid.isTrigger(24); //run14 200 GeV UPC_jpsiB in preparation
605  trg_3001 =ttid.isTrigger(11); //run14 UPC_Main
606  trg_2001 =ttid.isTrigger(24); //run14 UPC_jpsiA i
607  trg_2004 =ttid.isTrigger(14); //run14 UPC_topo
608  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_jpsiA ------------------------------------ " <<trg_3000<< endm;
609  }
610  if(triggerSel=="UPC_main_daq10k"){
611 
612  trg_3000 =ttid.isTrigger(3); //run14 200 GeV UPC_Main used to test daq10k
613 
614  LOG_INFO << "StPeCTrigger::value of trg_3000 UPC_main_daq10k ------------------------------------ " <<trg_3000<< endm;
615  }
616  } //15077---15170
617 
618  if(runN>16041100 && runN<= 16770001){
619  if(triggerSel=="RP_trig"){
620 
621  if(runN< 16064034) { //longitudinal polarization -----------------
622  if(ttid.isTrigger(470707)) trg_3000 = trg_3000 | (int)pow(2.0, 0.0); //RP_CP
623  if(ttid.isTrigger(470708)) trg_3000 = trg_3000 | (int)pow(2.0, 1.0); //RP_CPT
624  if(ttid.isTrigger(470711)) trg_3000 = trg_3000 | (int)pow(2.0, 2.0); //RP_CPX
625  if(ttid.isTrigger(9) ) trg_3000 = trg_3000 | (int)pow(2.0, 3.0); //RP_ET not elevated
626  if(ttid.isTrigger(470724)) trg_3000 = trg_3000 | (int)pow(2.0, 4.0); //RP_RPZMU changed ~4MAR
627  if(ttid.isTrigger(470701)) trg_3000 = trg_3000 | (int)pow(2.0, 5.0); //RP_SD
628  if(ttid.isTrigger(470703)) trg_3000 = trg_3000 | (int)pow(2.0, 6.0); //RP_SDT
629  if(ttid.isTrigger(470702)) trg_3000 = trg_3000 | (int)pow(2.0, 7.0); //RP_SDZ
630  if(ttid.isTrigger(470712)) trg_3000 = trg_3000 | (int)pow(2.0, 8.0); //RP_zerobias
631  if(ttid.isTrigger(470729)) trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_RP2MU elevated to physics in run 16054061 changed ~4MAR
632  if(ttid.isTrigger(470730)) trg_3000 = trg_3000 | (int)pow(2.0,10.0); //RP_RP2E elevated to physics in run 160..
633  if(ttid.isTrigger(470725)) trg_3000 = trg_3000 | (int)pow(2.0,11.0); //RP_RPZE elevated to physics in run 160..
634  }
635  if(runN>= 16064034 && runN< 16124016) { //transverse polarization -----------------
636  if(ttid.isTrigger(480707)) trg_3000 = trg_3000 | (int)pow(2.0, 0.0); //RP_CP
637  if(ttid.isTrigger(480713)) trg_3000 = trg_3000 | (int)pow(2.0, 1.0); //RP_CPT2
638  if(ttid.isTrigger(480711)) trg_3000 = trg_3000 | (int)pow(2.0, 2.0); //RP_CPX
639  if(ttid.isTrigger(480706)) trg_3000 = trg_3000 | (int)pow(2.0, 3.0); //RP_ET
640  if(ttid.isTrigger(480704)) trg_3000 = trg_3000 | (int)pow(2.0, 4.0); //RP_RPZMU changed ~4MAR
641  if(ttid.isTrigger(480701)) trg_3000 = trg_3000 | (int)pow(2.0, 5.0); //RP_SD
642  if(ttid.isTrigger(480703)) trg_3000 = trg_3000 | (int)pow(2.0, 6.0); //RP_SDT
643  if(ttid.isTrigger(480702)) trg_3000 = trg_3000 | (int)pow(2.0, 7.0); //RP_SDZ
644  if(ttid.isTrigger(480712)) trg_3000 = trg_3000 | (int)pow(2.0, 8.0); //RP_zerobias
645  if(ttid.isTrigger(480709)) trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_RP2MU elevated to physics in run 16054061 changed ~4MAR
646  if(ttid.isTrigger(480710)) trg_3000 = trg_3000 | (int)pow(2.0,10.0); //RP_RP2E elevated to physics in run 160..
647  if(ttid.isTrigger(480705)) trg_3000 = trg_3000 | (int)pow(2.0,11.0); //RP_RPZE elevated to physics in run 160..
648  }
649 
650  if(runN>= 16125033 && runN<16160013) { //transverse polarization p + Au starts
651 
652  if(runN>= 16125033 && runN< 16138047 &&ttid.isTrigger(500704)){
653  trg_3000 = trg_3000 | (int)pow(2.0, 4.0); //RP_ZMU changed ~4MAR
654  cout<<" ZMU "<<trg_3000<<endl;
655  }
656  if( ttid.isTrigger(500701)){
657  trg_3000 = trg_3000 | (int)pow(2.0, 5.0); //RP_SD
658  cout<<" SD "<<trg_3000<<endl;
659  }
660  if( ttid.isTrigger(500703)) {
661  trg_3000 = trg_3000 | (int)pow(2.0, 6.0); //RP_SDT
662  cout<<" SDT "<<trg_3000<<endl;
663  }
664  if(runN>= 16125033 && runN< 16138047 &&ttid.isTrigger(500709)) {
665  trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_2MU elevated to physics in run 16054061 changed ~4MAR
666  cout<<" 2MU "<<trg_3000<<endl;
667  }
668  if(runN>= 16138047 && runN< 16142049 &&ttid.isTrigger(500729)){
669  trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_2MU elevated to physics in run 16054061 changed ~4MAR
670  cout<<" 2MU B "<<trg_3000<<endl;
671  }
672  if(runN>= 16142049 && ttid.isTrigger(500749)) {
673  trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_2MU elevated to physics in run 16054061 changed ~4MAR
674  cout<<" ZMU "<<trg_3000<<endl;
675  }
676  if(runN>= 16138044 && ttid.isTrigger(500710)){
677  trg_3000 = trg_3000 | (int)pow(2.0,10.0); //RP_2E elevated to physics in run 160..
678  cout<<" 2E "<<trg_3000<<endl;
679  }
680  if(runN>= 16128030 && ttid.isTrigger(500000)) {
681  trg_3000 = trg_3000 | (int)pow(2.0,11.0); //RP_UPC elevated to physics in run 160..
682  cout<<" UPC "<<trg_3000<<endl;
683  }
684  //
685  // reserve for inclusion of trigger 2E starting on run 16149001 with id 500750 at run 16149044 before that it is 500730
686  if(runN>= 16149001 && runN< 16149044 && ttid.isTrigger(500730)) {
687  trg_3000 = trg_3000 | (int)pow(2.0,12.0); //2E elevated to physics in run 16149001
688  cout<<" UPC "<<trg_3000<<endl;
689  }
690  if(runN>= 16149044 && runN< 16159025 && ttid.isTrigger(500750)) {
691  trg_3000 = trg_3000 | (int)pow(2.0,12.0); //2E modified starting 16149044
692  cout<<" UPC "<<trg_3000<<endl;
693  }
694  }
695 
696  if(runN>= 16160012) { //transverse polarization p + Al starts
697 
698  if( ttid.isTrigger(510704)){
699  trg_3000 = trg_3000 | (int)pow(2.0, 4.0); //RP_ZMU changed ~4MAR
700  cout<<" ZMU "<<trg_3000<<endl;
701  }
702  if( ttid.isTrigger(510701)){
703  trg_3000 = trg_3000 | (int)pow(2.0, 5.0); //RP_SD
704  cout<<" SD "<<trg_3000<<endl;
705  }
706  if( ttid.isTrigger(510703)) {
707  trg_3000 = trg_3000 | (int)pow(2.0, 6.0); //RP_SDT
708  cout<<" SDT "<<trg_3000<<endl;
709  }
710  if( ttid.isTrigger(510709)) {
711  trg_3000 = trg_3000 | (int)pow(2.0, 9.0); //RP_2MU elevated to physics in run 16054061 changed ~4MAR
712  cout<<" 2MU "<<trg_3000<<endl;
713  }
714 
715  if( ttid.isTrigger(510710)){
716  trg_3000 = trg_3000 | (int)pow(2.0,10.0); //RP_2E elevated to physics in run 160..
717  cout<<" 2E "<<trg_3000<<endl;
718  }
719  if( ttid.isTrigger(510714)) {
720  trg_3000 = trg_3000 | (int)pow(2.0,11.0); //RP_UPC elevated to physics in run 160..
721  cout<<" UPC "<<trg_3000<<endl;
722  }
723  if(runN>= 16160032 && runN< 16169095 && ttid.isTrigger(510710)) {
724  trg_3000 = trg_3000 | (int)pow(2.0,12.0); //2E elevated to physics in run 16149001
725  cout<<" UPC "<<trg_3000<<endl;
726  }
727  }
728 
729  LOG_INFO << "StPeCTrigger::value of trg_3000 RP triggers ------------------------------------ " <<trg_3000<< endm;
730  }
731  }
732 
733  // run 2016 Au+Au 200GeV
734 
735  if(runN>= 17040085 && runN<17160013) { //
736  LOG_INFO << "StPeCTrigger::2016 ------------------------------------ " <<trg_3000<<" trigSel "<<triggerSel<<endm;
737  if(triggerSel=="UPC_trig"){
738  if( ttid.isTrigger(520701)){
739  trg_3000 = trg_3000 | (int)pow(2.0, 0.0); //UPC_main
740  cout<<" UPC_Main "<<trg_3000<<endl;
741  }
742  if( ttid.isTrigger(520702)){
743  trg_3000 = trg_3000 | (int)pow(2.0, 1.0); //UPC_zdcsum
744  cout<<" UPC_zdcsum "<<trg_3000<<endl;
745  }
746  if( ttid.isTrigger(520703)) {
747  trg_3000 = trg_3000 | (int)pow(2.0, 2.0); //UPC_JPsi
748  cout<<" UPC_JPsi "<<trg_3000<<endl;
749  }
750 
751 
752  }
753  LOG_INFO << "StPeCTrigger::2016 AFTER------------------------------------ " <<trg_3000<< endm;
754  }
755  //ignore trigger selection
756  if(triggerSel=="Ignore"){
757 
758  trg_3000 = 1;
759  trg_3001 = 0;
760 
761  LOG_INFO << "StPeCTrigger::Ignore trigger selection ------------------------------------ " <<trg_3000 << endm;
762  }
763 
764  lastDSM0 = trigData->lastDSM(0);
765  lastDSM1 = trigData->lastDSM(1);
766 
767 
768 
769  if(runN==14116064){
770  trg_3000 = ttid.isTrigger(1);
771  trg_3001 = ttid.isTrigger(2);
772  trg_3001 = ttid.isTrigger(4);
773  }
774  if(runN>14137093 && runN<15001001){
775  trg_3000 = ttid.isTrigger(3);
776  trg_3001 = ttid.isTrigger(430104);
777  trg_3001 = ttid.isTrigger(430605);
778  }
779 
780  }
781  } // if(&tt)
782 
783 // int bit5 = trigData->lastDSM(5/16) & (1<<(5 %16)) ? 1 : 0;
784 // int bit6 = trigData->lastDSM(6/16) & (1<<(6 %16)) ? 1 : 0;
785 // int bit17 = trigData->lastDSM(17/16) & (1<<(17 %16)) ? 1 : 0;
786 // int bit18 = trigData->lastDSM(18/16) & (1<<(18 %16)) ? 1 : 0;
787 // int bit22 = trigData->lastDSM(22/16) & (1<<(22 %16)) ? 1 : 0;
788 // int bit23 = trigData->lastDSM(23/16) & (1<<(23 %16)) ? 1 : 0;
789 // int bit24 = trigData->lastDSM(24/16) & (1<<(24 %16)) ? 1 : 0;
790 // int bit25 = trigData->lastDSM(25/16) & (1<<(25 %16)) ? 1 : 0;
791 // int bit96 = trigData->lastDSM(96/16) & (1<<(96 %16)) ? 1 : 0;
792 
793 
794  l0_2000->setInfoLevel ( infoLevel );
795 
796 
797 // StL0Trigger* l0Data = &mudst->event()->l0Trigger();
798 
799  StCtbTriggerDetector& ctb = mudst->event()->ctbTriggerDetector();
800 // StMwcTriggerDetector& mwc = &mudst->event()->ctbTriggerDetector();
801  StZdcTriggerDetector& zdc = mudst->event()->zdcTriggerDetector();
802  StBbcTriggerDetector& bbc = mudst->event()->bbcTriggerDetector();
803 
804  if(&zdc){
805  if ( infoLevel > 10 ) {
806  cout << "ZDC sum " << zdc.adcSum() << endl;
807  cout << "ZDC sum west " << zdc.adcSum(west) << endl;
808  cout << "ZDC sum east " << zdc.adcSum(east) << endl;
809  }
810  zdcCoincidenceRate = zdcRate;
811  // attenuated signals
812  zdcWest = trigData->zdcAttenuated(west);
813  zdcEast = trigData->zdcAttenuated(east);
814  zdcSum = zdcEast+zdcWest ;
815 
816  zdcWestTDC = trigData->zdcTDC(west);
817  zdcEastTDC = trigData->zdcTDC(east);
818  zdcTimeDifference = trigData->zdcTimeDifference();
819 
820  // unattenuated //
821  zdcWestUA = trigData->zdcUnAttenuated(west);
822  zdcEastUA = trigData->zdcUnAttenuated(east);
823  zdcSumUA = zdcEastUA+zdcWestUA ;
824  int hori = 1;
825  int vert = 0;
826  //SMD information
827 
828  for(int i=0;i<8;i++){
829  zdcSMDEastH[i] = trigData->zdcSMD(east, hori, i+1);
830  zdcSMDEastV[i] = trigData->zdcSMD(east, vert, i+1);
831  zdcSMDWestH[i] = trigData->zdcSMD(west, hori, i+1);
832  zdcSMDWestV[i] = trigData->zdcSMD(west, vert, i+1);
833  }
834 
835  zdcSMDHighestStripEastH = trigData->zdcSMDHighestStrip(east, hori);
836  zdcSMDHighestStripEastV = trigData->zdcSMDHighestStrip(east, vert);
837  zdcSMDHighestStripWestH = trigData->zdcSMDHighestStrip(west, hori);
838  zdcSMDHighestStripWestV = trigData->zdcSMDHighestStrip(west, vert);
839 
840  }
841  else {
842  zdcCoincidenceRate = 0.;
843  zdcWestUA = 0 ;
844  zdcEastUA = 0 ;
845  zdcSumUA = 0 ;
846 
847  zdcWest = 0 ;
848  zdcEast = 0 ;
849  zdcSum = 0 ;
850  zdcWestTDC = 0;
851  zdcEastTDC = 0;
852  zdcTimeDifference = 0;
853 
854  for(int i=0;i<8;i++){
855  zdcSMDEastH[i] = 0;
856  zdcSMDEastV[i] = 0;
857  zdcSMDWestH[i] = 0;
858  zdcSMDWestV[i] = 0;
859  }
860 
861 
862  zdcSMDHighestStripEastH = 0;
863  zdcSMDHighestStripEastV = 0;
864  zdcSMDHighestStripWestH = 0;
865  zdcSMDHighestStripWestV = 0;
866 
867  }
868 //
869 // CTB
870 //
871  float ctbsum=0.0;
872  ctbSW = 0 ;
873  ctbNW = 0 ;
874  ctbTW = 0 ;
875  ctbBW = 0 ;
876  ctbSE = 0 ;
877  ctbNE = 0 ;
878  ctbTE = 0 ;
879  ctbBE = 0 ;
880  nCtbHits = 0 ;
881  float ctbThres = 2. ;
882  if(&ctb){
883  TClonesArray &pCtbSlats = *ctbSlats;
884  for(i=0; i<120; i++){
885  for(j=0; j<2; j++){
886  ctbsum += ctb.mips(i,j,0);
887  if ( ctb.mips(i,j,0) > 0 ) {
888  Byte_t i_eta = (Byte_t)(j+1);
889  Byte_t i_phi = (Byte_t)(i+1);
890  Int_t adc = (Int_t)ctb.mips(i,j,0) ;
891  new(pCtbSlats[nCtbHits++]) StPeCCtbSlat(i_phi,i_eta,adc) ;
892  }
893 
894  if ( ctb.mips(i,j,0) > ctbThres ) {
895  if ( i >= 5 && i < 20 ) ctbSW++ ;
896  else if ( i >= 20 && i < 35 ) ctbBW++ ;
897  else if ( i >= 35 && i < 50 ) ctbNW++ ;
898  else if ( i >= 50 && i < 60 ) ctbTW++ ;
899  else if ( i < 5 ) ctbTW++ ;
900  else if ( i >= 65 && i < 80 ) ctbNE++ ;
901  else if ( i >= 80 && i < 95 ) ctbBE++ ;
902  else if ( i >= 95 && i < 110 ) ctbSE++ ;
903  else if ( i >= 110 ) ctbTE++ ;
904  else if ( i >= 60 && i < 65 ) ctbTE++ ;
905  }
906  }
907  }
908  if ( infoLevel > 10 )
909  cout << "CTB MIP total sum = " << ctbsum << endl;
910  }
911  ctbSum = ctbsum ;
912  mwcSum = 0 ;
913  //
914  //RD 24JULY temporary fix to see vertex for minbias_monitor events
915  StThreeVectorF vtx = mudst->event()->primaryVertexPosition();
916 
917  size_t Nvert = mudst->numberOfPrimaryVertices();
918  LOG_INFO << "StPeCTrigger::fill(event mudst) #vertices: " <<Nvert<< endm;
919  for (size_t verti = 0;verti<Nvert;++verti){
920 // LOG_INFO << "StPeCTrigger:: vertex Index: "<<verti<<endm;
921  StMuPrimaryVertex* V= mudst->primaryVertex(verti);
922  assert(V);
923  mudst->setVertexIndex(verti);
924  const StThreeVectorF &r=V->position();
925 // LOG_INFO <<" number of Tracks used "<<V->nTracksUsed()<<" number TOF hits matched "<<V->nBTOFMatch()<<" number all tracks "<<V->noTracks() <<endm;
926 // cout<<" z vertex "<<r.z()<<endl;
927  }
928 // StThreeVectorF vtx = vertex->position();
929  ctbSum = vtx.z();
930 // cout<<" single vertex z "<<ctbSum<<endl;
931  //
932  //
933  // BBC
934  if(&bbc){
935 
936  bbcAdcSumEastSm=bbc.adcSumEast();
937  bbcAdcSumWestSm=bbc.adcSumWest();
938  bbcAdcSumEastLg=bbc.adcSumEastLarge();;
939  bbcAdcSumWestLg=bbc.adcSumWestLarge();;
940 
941 // bbcNHitEastSm=bbc.nHitEast();
942 // bbcNHitWestSm=bbc.nHitWest();
943 // bbcNHitEastLg=bbc.nHitEastLarge();;
944 // bbcNHitWestLg=bbc.nHitWestLarge();;
945 
946  bbcTacEast = trigData->bbcEarliestTDC(east);
947  bbcTacWest = trigData->bbcEarliestTDC(west);
948  bbcTimeDiff = trigData->bbcTimeDifference();
949  for(int i=0;i<36;i++){
950  bbcTDCEast[i] = trigData->bbcTDC(east, i+1);
951  bbcTDCWest[i] = trigData->bbcTDC(west, i+1);
952  bbcADCEast[i] = trigData->bbcADC(east, i+1);
953  bbcADCWest[i] = trigData->bbcADC(west, i+1);
954  }
955 
956 
957 
958  } else {
959  bbcAdcSumEastSm=0;
960  bbcAdcSumWestSm=0;
961  bbcAdcSumEastLg=0;
962  bbcAdcSumWestLg=0;
963 
964  bbcNHitEastSm=0;
965  bbcNHitWestSm=0;
966  bbcNHitEastLg=0;
967  bbcNHitWestLg=0;
968 
969  bbcTacEast=0;
970  bbcTacWest=0;
971  bbcTimeDiff = 0;
972 
973  for(int i=0;i<36;i++){
974  bbcTDCEast[i] = 0;
975  bbcTDCWest[i] = 0;
976  }
977 
978 
979 
980  }
981  //
982  //12-JULY-2012 RD get TOF information in trigger
983  //
984  unsigned short tofMult;
985  tofMult = trigData->tofMultiplicity();
986  nBtofTriggerHits = tofMult;
987  nBTOFhits = mudst->numberOfBTofHit();
988  nPrimaryTracks = mudst->numberOfPrimaryTracks();
989 
990 // double leadingT ;
991  for(int itof=0;itof<tofMult;itof++) {
992  StMuBTofHit * leading = mudst->btofHit(itof); //->leadingEdgeTime();
993  //leadingT = leading->leadingEdgeTime();
994  }
995  //
996  // 1-MAY-2013 pass bunchId
997  //
998  bunchId = trigData->bunchId7Bit();
999 //
1000 // Simulate l0
1001 //
1002  p4 = l0_2000->process(mudst);
1003  p4c = l0_2000Corrected->process(mudst);
1004  p5 = l0Offline2001->process(mudst);
1005 //
1006 // Take quadrants from 2001 wiring
1007 //
1008  // L0 simulator
1009  Bool_t trgOut[40];
1010  {for ( int i = 0 ; i < 40 ; i++ ) trgOut[i] = 0 ;}
1011 
1012  if ( infoLevel > 20 ) {
1013  printf ( "trgBits : " ) ;
1014  for ( int i = 0 ; i < 24 ; i++ ) {
1015  printf ( "%d ", trgOut[i] ) ;
1016  }
1017  printf ( "\n" ) ;
1018  }
1019 // return 0 ; //standard return (unused)
1020 
1021  return trg_3000 ; //to pass UPC_Main trigger selection or all RP triggers in that single int
1022 }
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Definition: StMuDst.h:322
static StMuBTofHit * btofHit(int i)
returns pointer to the i-th muBTofHit
Definition: StMuDst.h:419
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in &#39;physical events&#39;. Therefore there is only 1 primary vert...
Definition: StMuEvent.cxx:221
Collection of trigger ids as stored in StEvent.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
Definition: StMuDst.cxx:273
Collection of trigger ids as stored in MuDst.