13 #include "TClonesArray.h"
14 #include "StEmcOfflineCalibrationEvent.h"
31 void StEmcOfflineCalibrationTrack::Clear(Option_t* option)
33 fill(mTowerId, mTowerId+9, -1);
34 fill(mTowerAdc, mTowerAdc+9, -1);
35 fill(mTowerStatus, mTowerStatus+9, -1);
36 fill(mTowerPed, mTowerPed+9, -1.);
37 fill(mTowerPedRms, mTowerPedRms+9, -1.);
39 fill(mPreshowerAdc, mPreshowerAdc+9, -1);
40 fill(mPreshowerStatus, mPreshowerStatus+9, -1);
41 fill(mPreshowerPed, mPreshowerPed+9, -1.);
42 fill(mPreshowerPedRms, mPreshowerPedRms+9, -1.);
44 fill(mSmdeId, mSmdeId+11, -1);
45 fill(mSmdeAdc, mSmdeAdc+11, -1);
46 fill(mSmdeStatus, mSmdeStatus+11, -1);
47 fill(mSmdePed, mSmdePed+11, -1.);
48 fill(mSmdePedRms, mSmdePedRms+11, -1.);
50 fill(mSmdpId, mSmdpId+11, -1);
51 fill(mSmdpAdc, mSmdpAdc+11, -1);
52 fill(mSmdpStatus, mSmdpStatus+11, -1);
53 fill(mSmdpPed, mSmdpPed+11, -1.);
54 fill(mSmdpPedRms, mSmdpPedRms+11, -1.);
70 mNSigmaElectron = -99.;
74 mHighestNeighbor = -99.;
77 mMomentum.setX(-99.); mMomentum.setY(-99.); mMomentum.setZ(-99.);
79 mTofMatchedFlag = -10;
84 mTofPathLength = -10.;
85 mTofSigmaElectron = -100.;
86 mTofProbElectron = -100.;
89 void StEmcOfflineCalibrationTrack::setTowerId(Int_t
id, Int_t aTid) { mTowerId[id] = aTid; }
90 void StEmcOfflineCalibrationTrack::setTowerAdc(Int_t
id, Int_t aAdc) { mTowerAdc[id] = aAdc; }
91 void StEmcOfflineCalibrationTrack::setTowerStatus(Int_t
id, Int_t aStat) { mTowerStatus[id] = aStat; }
92 void StEmcOfflineCalibrationTrack::setTowerPedestal(Int_t
id, Float_t aPed) { mTowerPed[id] = aPed; }
93 void StEmcOfflineCalibrationTrack::setTowerPedestalRms(Int_t
id, Float_t aRms) { mTowerPedRms[id] = aRms; }
94 void StEmcOfflineCalibrationTrack::setPreshowerAdc(Int_t
id, Int_t bAdc) { mPreshowerAdc[id] = bAdc; }
95 void StEmcOfflineCalibrationTrack::setPreshowerStatus(Int_t
id, Int_t bStat) { mPreshowerStatus[id] = bStat; }
96 void StEmcOfflineCalibrationTrack::setPreshowerPedestal(Int_t
id, Float_t bPed) { mPreshowerPed[id] = bPed; }
97 void StEmcOfflineCalibrationTrack::setPreshowerPedestalRms(Int_t
id, Float_t bRms) { mPreshowerPedRms[id] = bRms; }
98 void StEmcOfflineCalibrationTrack::setPreshowerCap(Int_t
id, UChar_t bCap) { mPreshowerCap[id] = bCap; }
100 void StEmcOfflineCalibrationTrack::setSmdeId(Int_t
id, Int_t smdeId) { mSmdeId[id] = smdeId; }
101 void StEmcOfflineCalibrationTrack::setSmdeAdc(Int_t
id, Int_t smdeAdc) { mSmdeAdc[id] = smdeAdc; }
102 void StEmcOfflineCalibrationTrack::setSmdeStatus(Int_t
id, Int_t smdeStat) { mSmdeStatus[id] = smdeStat; }
103 void StEmcOfflineCalibrationTrack::setSmdePedestal(Int_t
id, Float_t smdePed) { mSmdePed[id] = smdePed; }
104 void StEmcOfflineCalibrationTrack::setSmdePedestalRms(Int_t
id, Float_t smdeRms) { mSmdePedRms[id] = smdeRms; }
105 void StEmcOfflineCalibrationTrack::setSmdpId(Int_t
id, Int_t smdpId) { mSmdpId[id] = smdpId; }
106 void StEmcOfflineCalibrationTrack::setSmdpAdc(Int_t
id, Int_t smdpAdc) { mSmdpAdc[id] = smdpAdc; }
107 void StEmcOfflineCalibrationTrack::setSmdpStatus(Int_t
id, Int_t smdpStat) { mSmdpStatus[id] = smdpStat; }
108 void StEmcOfflineCalibrationTrack::setSmdpPedestal(Int_t
id, Float_t smdpPed) { mSmdpPed[id] = smdpPed; }
109 void StEmcOfflineCalibrationTrack::setSmdpPedestalRms(Int_t
id, Float_t smdpRms) { mSmdpPedRms[id] = smdpRms; }
111 void StEmcOfflineCalibrationTrack::setTowerExitId(Int_t aTowExitId) { mTowerExitId = aTowExitId; }
112 void StEmcOfflineCalibrationTrack::setVertexIndex(Int_t aVertInd) { mVertexIndex = aVertInd; }
113 void StEmcOfflineCalibrationTrack::setFlag(Int_t aFlag) { mFlag = aFlag; }
114 void StEmcOfflineCalibrationTrack::setBad(Int_t aBad) { mBad = aBad; }
115 void StEmcOfflineCalibrationTrack::setNHits(Int_t aHits) { mNHits = aHits; }
116 void StEmcOfflineCalibrationTrack::setNFitPoints(Int_t aFitPts) { mNFitPoints = aFitPts; }
117 void StEmcOfflineCalibrationTrack::setNDedxPoints(Int_t aDeDxPts) { mNDedxPoints = aDeDxPts; }
118 void StEmcOfflineCalibrationTrack::setNHitsPossible(Int_t aHitsPoss) { mNHitsPossible = aHitsPoss; }
119 void StEmcOfflineCalibrationTrack::setCharge(Int_t aCharge) { mCharge = aCharge; }
120 void StEmcOfflineCalibrationTrack::setP(Double_t aP) { mP = aP; }
121 void StEmcOfflineCalibrationTrack::setEta(Double_t aEta) { mEta = aEta; }
122 void StEmcOfflineCalibrationTrack::setPhi(Double_t aPhi) { mPhi = aPhi; }
123 void StEmcOfflineCalibrationTrack::setDeDx(Double_t aDeDx) { mDeDx = aDeDx; }
124 void StEmcOfflineCalibrationTrack::setNSigmaElectron(Double_t aNSElec) { mNSigmaElectron = aNSElec; }
125 void StEmcOfflineCalibrationTrack::setNSigmaPion(Double_t aNSPion) { mNSigmaPion = aNSPion; }
126 void StEmcOfflineCalibrationTrack::setNSigmaKaon(Double_t aNSKaon) { mNSigmaKaon = aNSKaon; }
127 void StEmcOfflineCalibrationTrack::setNSigmaProton(Double_t aNSProton) { mNSigmaProton = aNSProton; }
128 void StEmcOfflineCalibrationTrack::setHighestNeighbor(Float_t aHN) { mHighestNeighbor = aHN; }
129 void StEmcOfflineCalibrationTrack::setDeta(Float_t aDeta) { mDeta = aDeta; }
130 void StEmcOfflineCalibrationTrack::setDphi(Float_t aDphi) { mDphi = aDphi; }
131 void StEmcOfflineCalibrationTrack::setMomentum(
StThreeVectorF aMom) { mMomentum = aMom; }
132 void StEmcOfflineCalibrationTrack::setTofMatchedFlag(Int_t aTofFlag) { mTofMatchedFlag = aTofFlag; }
133 void StEmcOfflineCalibrationTrack::setVpdVz(Float_t aVpdVz) { mVpdVz = aVpdVz; }
134 void StEmcOfflineCalibrationTrack::setDcaGlobal(Float_t aDca) { mDcaGlobal = aDca; }
135 void StEmcOfflineCalibrationTrack::setTofTime(Float_t aTofTime) { mTofTime = aTofTime; }
136 void StEmcOfflineCalibrationTrack::setTofBeta(Float_t aTofBeta) { mTofBeta = aTofBeta; }
137 void StEmcOfflineCalibrationTrack::setTofPathlength(Float_t aTofPL) { mTofPathLength = aTofPL; }
138 void StEmcOfflineCalibrationTrack::setTofSigmaElectron(Float_t aTofSE) { mTofSigmaElectron = aTofSE; }
139 void StEmcOfflineCalibrationTrack::setTofProbElectron(Float_t aTofPE) { mTofProbElectron = aTofPE; }
141 StEmcOfflineCalibrationEvent::StEmcOfflineCalibrationEvent()
143 mTracks =
new TClonesArray(
"StEmcOfflineCalibrationTrack",150);
144 mTriggers =
new TClonesArray(
"StEmcOfflineCalibrationTrigger",20);
145 mVertices =
new TClonesArray(
"StEmcOfflineCalibrationVertex",10);
149 StEmcOfflineCalibrationEvent::~StEmcOfflineCalibrationEvent()
156 if(mTracks)
delete mTracks;
157 if(mVertices)
delete mVertices;
158 if(mTriggers)
delete mTriggers;
161 void StEmcOfflineCalibrationEvent::Clear(Option_t* option)
163 mTracks->Clear(option);
164 mTriggers->Clear(option);
165 mVertices->Clear(option);
173 fill(mHighTowerTh, mHighTowerTh+4, 0);
174 fill(mHighTowerAdc, mHighTowerAdc+4800, 0);
177 Int_t StEmcOfflineCalibrationEvent::nVertices()
const {
return mVertices->GetEntriesFast(); }
178 Int_t StEmcOfflineCalibrationEvent::nTriggers()
const {
return mTriggers->GetEntriesFast(); }
179 Int_t StEmcOfflineCalibrationEvent::nTracks()
const {
return mTracks->GetEntriesFast(); }
184 TClonesArray *tmp = this->triggers();
185 for(
int i=0; i<tmp->GetEntries(); i++) {
187 if(trigger->trigId() == trigId)
return trigger;
192 map<Int_t, Int_t> StEmcOfflineCalibrationEvent::towersAboveHighTowerTh(Int_t th)
const
194 map<Int_t, Int_t> aMap;
195 for (Int_t iTow = 0; iTow < 4800; ++iTow){
196 Int_t softId = iTow+1;
197 Int_t mAdc = highTowerAdc(softId);
198 if (mAdc > highTowerTh(th))
199 aMap.insert(make_pair(softId,mAdc));
204 void StEmcOfflineCalibrationEvent::setFill(Int_t aFill) { mFillNum = aFill; }
205 void StEmcOfflineCalibrationEvent::setRunNum(Int_t aRunNum) { mRunNum = aRunNum; }
206 void StEmcOfflineCalibrationEvent::setEventId(Int_t aEventId) { mEventId = aEventId; }
207 void StEmcOfflineCalibrationEvent::setDate(Int_t aDate) { mDate = aDate; }
208 void StEmcOfflineCalibrationEvent::setTime(Int_t aTime) { mTime = aTime; }
209 void StEmcOfflineCalibrationEvent::setHighTowerTh(Int_t level, Int_t thresh) { mHighTowerTh[level] = thresh; }
210 void StEmcOfflineCalibrationEvent::setHighTowerAdc(Int_t softId, Int_t adc) { mHighTowerAdc[softId-1] = adc; }
227 StEmcOfflineCalibrationTrigger::StEmcOfflineCalibrationTrigger()
234 void StEmcOfflineCalibrationTrigger::InitTrigValues()
241 void StEmcOfflineCalibrationTrigger::ClearTrigValues()
246 void StEmcOfflineCalibrationTrigger::setTrigId(Int_t aTrigId) { mTrigId = aTrigId; }
247 void StEmcOfflineCalibrationTrigger::setDidFire(Bool_t aDidFire) { mDidFire = aDidFire; }
248 void StEmcOfflineCalibrationTrigger::setShouldFire(Bool_t aShouldFire) { mShouldFire = aShouldFire; }
250 StEmcOfflineCalibrationVertex::StEmcOfflineCalibrationVertex()
254 mX = mY = mZ = -999.;
258 void StEmcOfflineCalibrationVertex::setRanking(Double_t aRanking) { mRanking = aRanking; }
259 void StEmcOfflineCalibrationVertex::setX(Double_t aX) { mX = aX; }
260 void StEmcOfflineCalibrationVertex::setY(Double_t aY) { mY = aY; }
261 void StEmcOfflineCalibrationVertex::setZ(Double_t aZ) { mZ = aZ; }
263 StEmcOfflineCalibrationCluster::StEmcOfflineCalibrationCluster(){ Clear(); }
266 void StEmcOfflineCalibrationCluster::Clear(Option_t *option){ mNeighborTracks.Clear(); mCentralTrack = 0; }
~StEmcOfflineCalibrationVertex()
~StEmcOfflineCalibrationTrigger()
~StEmcOfflineCalibrationCluster()
~StEmcOfflineCalibrationTrack()