StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2009W_trigger.cxx
1 // $Id: St2009W_trigger.cxx,v 1.6 2011/09/14 14:23:21 stevens4 Exp $
2 //
3 //*-- Author : Ross Corliss, MIT
4 
5 #include "St2009WMaker.h"
6 #include "StEmcUtil/geometry/StEmcGeom.h"
7 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
8 
9 //________________________________________________
10 //________________________________________________
11 bool
12 St2009WMaker::passes_L0(){
13  /*
14  In 2009, L2W fed off the BHT3 L0 trigger, which required a single
15  high tower to have an ADC of greater than 30. This is the default
16  threshold, but can be set from the macro if a different value is
17  needed.
18  */
19 
20  StMuEvent* muEve = mMuDstMaker->muDst()->event();
21  for (int m=0;m<300;m++)
22  if(muEve->emcTriggerDetector().highTower(m)>par_l0emulAdcThresh) return true;
23  return false;
24 }
25 
26 //________________________________________________
27 //________________________________________________
28 bool
29 St2009WMaker::passes_L2(){
30  /*
31  In 2009, the L2W trigger required a 2x2 patch of barrel towers
32  where one tower has more than 5.0GeV and the sum of all four is
33  E_T>13.0GeV. These thresholds are the defaults, but can be set
34  from the macro if a different value is needed.
35  */
36 
37  for (int i=0;i<mxBtow;i++) //loop all towers
38  if (wEve.bemc.statTile[0][i]==0) {//zero means good
39  float adc = wEve.bemc.adcTile[0][i];
40  float ET = adc*60./4096.; //ideal gains
41  if (ET>par_l2emulSeedThresh) { // pass single tower thresh
42 
43  int iEta,iPhi; //get eta and phi bins for tower
44  if( L2algoEtaPhi2IJ(positionBtow[i].Eta(),positionBtow[i].Phi(),iEta,iPhi)) continue;
45 
46  float maxET=0;
47 
48  //sum 2x2 cluster with ideal gains
49  int I0=iEta-1; int J0=iPhi-1;
50  for(int I=I0;I<=I0+1;I++){ //loop eta
51  for(int J=J0;J<=J0+1;J++) { //loop phi
52  WeveCluster CL;CL.iEta=I;CL.iPhi=J; //tmp clus
53  for(int i=I;i<I+2;i++){//trim in eta-direction
54  if(i<0) continue;
55  if(i>=mxBTetaBin) continue;
56  for(int j=J;j<J+2;j++) {// wrap up in phi
57  int jj=(j+mxBTphiBin)%mxBTphiBin;// keep it pos
58 
59  int softID = mapBtowIJ2ID[ i+ jj*mxBTetaBin];
60  float adc = wEve.bemc.adcTile[kBTow][softID-1];
61  if(adc<=0) continue; // skip towers w/o energy
62  float ET = adc*60./4096.;
63  CL.nTower++;
64  CL.ET+=ET;
65  CL.adcSum+=adc;
66  }
67  }
68 
69  if(maxET>CL.ET) continue;
70  maxET=CL.ET;
71  }
72  }
73 
74  //passes L2 theshold
75  if(maxET>par_l2emulClusterThresh) return true;
76  }
77  }
78  return false;
79 
80 }
81 
82  void
83  St2009WMaker::patchToEtaPhi(int patch, int*eta, int*phi)
84  {
85  if (patch<0 || patch>299)
86  {
87  printf("patchToEtaPhi p=%d, out of range. Eta phi not defined.\n",patch);
88  return;
89  }
90  if (patch<150)
91  {
92  int m=14-patch/10;
93  int n=patch%10;
94  *eta=n/2+5;
95  *phi=n%2+m*2;
96  }
97  else
98  {
99  int m=29-patch/10;
100  int n=patch%10;
101  *eta=4-n/2;
102  *phi=1-n%2+m*2;
103  }
104  return;
105  }
106 
107 //$Log: St2009W_trigger.cxx,v $
108 //Revision 1.6 2011/09/14 14:23:21 stevens4
109 //update used for cross section PRD paper
110 //
111 //Revision 1.5 2010/12/02 18:31:43 rcorliss
112 //updated lumi code to match the starnote version
113 //
114 //Revision 1.4 2010/05/13 00:53:52 rcorliss
115 //fixed missing #include
116 //
117 //Revision 1.3 2010/05/12 19:04:05 rcorliss
118 //Corrected passes_L0() to use trigger patches instead of wEvent tiles.
119 //
120 //Revision 1.2 2010/01/13 03:34:20 stevens4
121 //give trig emulator access to barrel hits
122 //
123 //Revision 1.1 2009/11/23 23:00:18 balewski
124 //code moved spin-pool
125 //
StMuDst * muDst()
Definition: StMuDstMaker.h:425
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320