StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcMixEvent.cxx
1 #include "StEEmcMixEvent.h"
2 ClassImp(StEEmcMixEvent);
3 
4 // ----------------------------------------------------------------------------
5 StEEmcMixEvent::StEEmcMixEvent()
6 {
7  for ( Int_t ii=0;ii<90;ii++ )
8  {
9  pedEEmcDSM_HT[ii]=1;
10  pedEEmcDSM_TP[ii]=1;
11  }
12 
13  for ( Int_t ii=0;ii<10;ii++ )
14  {
15  pedEEmcDSM_TP[ii+00] = (ii%2)? 3 : 5;
16  pedEEmcDSM_TP[ii+20] = (ii%2)? 3 : 5;
17  pedEEmcDSM_TP[ii+30] = (ii%2)? 3 : 5;
18  pedEEmcDSM_TP[ii+50] = (ii%2)? 3 : 5;
19  pedEEmcDSM_TP[ii+60] = (ii%2)? 3 : 5;
20  pedEEmcDSM_TP[ii+80] = (ii%2)? 3 : 5;
21  }
22  Clear();
23 }
24 
25 // ----------------------------------------------------------------------------
26 void StEEmcMixEvent::setEvent( StMuEvent *event )
27 {
28 
29  mEventId = event->eventId();
30  mEventNumber = event->eventNumber();
31  mRunId = event->runId();
32  mRunNumber = event->runNumber();
33  mEventInfo = event->eventInfo();
34  mRunInfo = event->runInfo();
35  mL0trigger = event->l0Trigger();
36  mMuTriggerIdCollection = event->triggerIdCollection();
37  mMagneticField = event->magneticField();
38  mBbcTrigger = event->bbcTriggerDetector();
39  mEmcTrigger = event->emcTriggerDetector();
40 
41 }
42 
43 
44 // ----------------------------------------------------------------------------
45 void StEEmcMixEvent::Clear(Option_t *o)
46 {
47  nPairs=0;
48  /***
49  for ( Int_t i=0;i<MAX_PAIRS;i++ )
50  {
51  mMass[i]=0.;
52  mPT[i]=0.;
53  mEta[i]=-10.;
54  mPhi[i]=-10.;
55  mZgg[i]=0.;
56  mPhigg[i]=0.;
57  mEnergy[i]=0.;
58  mEpre1[i]=0.;
59  mEpre2[i]=0.;
60  mEpost[i]=0.;
61  mEsmdu[i]=0.;
62  mEsmdv[i]=0.;
63  mZvertex[i]=0.;
64 
65  mTower1[i]=0;
66  mTower2[i]=0;
67  mEnergy1[i]=0.;
68  mEnergy2[i]=0.;
69 
70  mNumberT[i]=0;
71  mNumberR[i]=0;
72  mNumberU[i]=0;
73  mNumberV[i]=0;
74  }
75  **/
76 
77  mMass.clear();
78  mPT.clear();
79  mEta.clear();
80  mPhi.clear();
81  mZgg.clear();
82  mPhigg.clear();
83  mEnergy.clear();
84  mEpre1.clear();
85  mEpre2.clear();
86  mEpost.clear();
87  mEsmdu.clear();
88  mEsmdv.clear();
89  mZvertex.clear();
90 
91  mTower1.clear();
92  mTower2.clear();
93  mEnergy1.clear();
94  mEnergy2.clear();
95 
96  mNumberT.clear();
97  mNumberR.clear();
98  mNumberU.clear();
99  mNumberV.clear();
100 
101  mNumberOfTracks.clear();
102  mNumberOfPoints.clear();
103 
104  mNumberOfTowerClusters.clear();
105  mNumberOfSmduClusters.clear();
106  mNumberOfSmdvClusters.clear();
107 
108  for ( Int_t ii=0;ii<720;ii++ ) {
109  mADC[ii]=0.;
110  mGain[ii]=-1.;
111  mStat[ii]=0;
112  }
113 
114 
115 
116  mTotalEnergyT=0.;
117  mTotalEnergyP=0.;
118  mTotalEnergyQ=0.;
119  mTotalEnergyR=0.;
120  mTotalEnergyU=0.;
121  mTotalEnergyV=0.;
122 
123 }
124 
125 // ----------------------------------------------------------------------------
126 void StEEmcMixEvent::addPair ( StEEmcPair p ) {
127 
128  // mMass[nPairs] = p.mass();
129 
130  mMass.push_back ( p.mass() );
131  mPT.push_back( p.pt() );
132  mEta.push_back( p.momentum().Eta() );
133  mPhi.push_back( p.momentum().Phi() );
134  mPhigg.push_back( p.phigg() );
135  mZgg.push_back( p.zgg() );
136  mEnergy.push_back( p.energy() );
137 
138  Float_t esmdu=0.;
139  Float_t esmdv=0.;
140  esmdu += p.point(0).cluster(0).energy();
141  esmdu += p.point(1).cluster(0).energy();
142  esmdv += p.point(0).cluster(1).energy();
143  esmdv += p.point(1).cluster(1).energy();
144 
145  Int_t index1=p.point(0).tower(0).index();
146  Int_t index2=p.point(1).tower(0).index();
147 
148  Float_t epre1 = 0.;
149  epre1 += p.point(0).energy(1);
150  if (index1!=index2) epre1 += p.point(1).energy(1);
151 
152  Float_t epre2 = 0.;
153  epre2 += p.point(0).energy(2);
154  if (index1!=index2) epre2 += p.point(1).energy(2);
155 
156  Float_t epost = 0.;
157  epost += p.point(0).energy(3);
158  if (index1!=index2) epost += p.point(1).energy(3);
159 
160  mEpre1.push_back( epre1 );
161  mEpre2.push_back( epre2 );
162  mEpost.push_back( epost );
163  mEsmdu.push_back( esmdu );
164  mEsmdv.push_back( esmdv );
165 
166  mZvertex.push_back( p.vertex().Z() );
167 
168  mTower1.push_back( p.point(0).tower(0).index() );
169  mTower2.push_back( p.point(1).tower(0).index() );
170  mEnergy1.push_back( p.point(0).energy() );
171  mEnergy2.push_back( p.point(1).energy() );
172 
173  nPairs++;
174 
175 }
176 
177 // ----------------------------------------------------------------------------
178 Float_t StEEmcMixEvent::sum3x3(Int_t index)
179 {
180  Float_t sum=this->mADC[index];
181  Int_t ieta = index%12;
182  Int_t iphi = index/12;
184  for ( Int_t jeta=ieta-1;jeta<=ieta+1;jeta++ ) {
185  if ( jeta<0||jeta>11 ) continue;
186  for ( Int_t jphi=iphi-1;jphi<=iphi+1;jphi++ ) {
187  Int_t myeta=jeta;
188  Int_t myphi=(jphi+60)%60;
189  if ( myeta==ieta&&myphi==iphi ) continue;
190  Float_t myEt=this->mADC[ myeta + 12*myphi ];
191  sum += myEt;
192  }
193  }
194  return sum;
195 }
196 Float_t StEEmcMixEvent::sum3x3()
197 {
198  Float_t max=0.;
199  Int_t index = 0;
200  for ( Int_t ii=0;ii<720;ii++ )
201  if ( this->mADC[ii] > max ) {
202  index=ii;
203  max=this->mADC[ii];
204  }
205  return sum3x3(index);
206 }
207 Float_t StEEmcMixEvent::htdsm()
208 {
209  Float_t max=0.;
210  for ( Int_t ii=0;ii<90;ii++ ) {
211  Float_t dsm=mEmcTrigger.highTowerEndcap(ii);
212  dsm-=pedEEmcDSM_HT[ii];
213  if ( dsm>max ) max=dsm;
214  }
215  return max;
216 }
217 Float_t StEEmcMixEvent::tpdsm()
218 {
219  Float_t max=0.;
220  for ( Int_t ii=0;ii<90;ii++ ) {
221  Float_t dsm=mEmcTrigger.patchEndcap(ii);
222  dsm-=pedEEmcDSM_TP[ii];
223  if ( dsm>max ) max=dsm;
224  }
225  return max;
226 }
227 Int_t StEEmcMixEvent::npi0()
228 {
229  Int_t count=0;
230  for ( Int_t ii=0;ii<TMath::Min(5,nPairs);ii++ )
231  {
232  if ( mMass[ii]>0.11 && mMass[ii]<0.17 ) count++;
233  }
234  return count;
235 }
236 Int_t StEEmcMixEvent::deta(Int_t id)
237 {
238  if ( id<0||id>=nPairs)
239  return -1;
240  Int_t del = ( mTower1[id]%12 - mTower2[id]%12 );
241  return TMath::Abs(del);
242 }
243 Int_t StEEmcMixEvent::dphi(Int_t id)
244 {
245  if ( id<0||id>=nPairs)
246  return -1;
247  Int_t del = ( mTower1[id]/12 - mTower2[id]/12 + 60 ) % 60;
248  return TMath::Abs(del);
249 }
Int_t nPairs
From EEMC point-maker.
void cluster(const StEEmcSmdCluster &c, Int_t plane)
Add an smd cluster to this point.
Definition: StEEmcPoint.h:40
void energy(Float_t e, Int_t layer=0)
Set the energy of this point.
Definition: StEEmcPoint.h:34
const TVector3 & momentum() const
Returns momentum of pair.
Definition: StEEmcPair.h:78
const TVector3 & vertex() const
Returns vertex of pair.
Definition: StEEmcPair.h:79
copied from muDst
const StEEmcPoint & point(Int_t index) const
Definition: StEEmcPair.h:30
std::vector< Int_t > mNumberOfPoints
Float_t sum3x3(Int_t index)
Float_t zgg() const
Returns energy-sharing of pair.
Definition: StEEmcPair.h:75
Float_t energy() const
Returns energy of pair.
Definition: StEEmcPair.h:74
void tower(const StEEmcTower &t, Float_t w=1.)
Add a tower with specified weight to the point.
Definition: StEEmcPoint.h:38
Int_t mEventId
Items to be copied from StMuEvent.
std::vector< Int_t > mNumberOfTracks
Float_t mass() const
Returns invariant mass of pair.
Definition: StEEmcPair.h:73
Float_t mADC[720]
Float_t phigg() const
Returns opening-angle of pair.
Definition: StEEmcPair.h:76
Float_t pt() const
Returns pt of pair.
Definition: StEEmcPair.h:77
A class to represent pairs of points.
Definition: StEEmcPair.h:9