4 #include <TClonesArray.h>
7 #include "EEtwHitDst.h"
8 #include "EEsmdHitDst.h"
9 #include "EEsectorDst.h"
19 Pre1Hits =
new TClonesArray(
"EEtwHitDst",1000);
20 Pre2Hits =
new TClonesArray(
"EEtwHitDst",1000);
21 TwHits =
new TClonesArray(
"EEtwHitDst",1000);
22 SmdUHits =
new TClonesArray(
"EEsmdHitDst",1000);
23 SmdVHits =
new TClonesArray(
"EEsmdHitDst",1000);
24 PostHits =
new TClonesArray(
"EEtwHitDst",1000);
30 EEsectorDst::~EEsectorDst() {
42 void EEsectorDst::clear(){
55 void EEsectorDst::print(
int k){
57 LOG_INFO<<Form(
"EEsectorDst(ID=%d)::print() nPre1Hit=%d nPre2Hit=%d nSmdUHit=%d nSmdVHit=%d nTowerHit=%d nPostHit=%d \n",
ID,Pre1Hits->GetEntries(),Pre2Hits->GetEntries(),SmdUHits->GetEntries(),SmdVHits->GetEntries(),TwHits->GetEntries(),PostHits->GetEntries())<<endm;
61 LOG_INFO<<Form(
"EEsectorDst(Tower) nHit=%d\n",TwHits->GetEntries())<<endm;
64 TClonesArray *hitA=getTwHits();
65 for(i=0;i<hitA->GetEntries();i++){
70 LOG_INFO<<Form (
"EEsectorDst(pre/post/SMD) not implemented\n")<<endm;
77 void EEsectorDst::addTwHit(
char sub,
int eta,
float ener, TClonesArray *hitA) {
79 TClonesArray &hits = *hitA;
80 int len=hits.GetEntries();
82 hit->set(sub,eta,ener);
90 void EEsectorDst::addSmdHit(
int strip,
float ener, TClonesArray *hitA) {
92 TClonesArray &hits = *hitA;
93 int len=hits.GetEntries();
103 void EEsectorDst::sumRawMC(
EEsectorDst *outSec,
float minE) {
117 sumRawMCtw(Pre1Hits,sum1,mx);
118 sumRawMCtw(Pre2Hits,sum2,mx);
120 sumRawMCsmd(SmdUHits ,sumU,mx2);
121 sumRawMCsmd(SmdVHits ,sumV,mx2);
122 sumRawMCtw(TwHits ,sum3,mx);
123 sumRawMCtw(PostHits,sum4,mx);
143 float ener14=ener1+ener2+ener3+ener4;
148 addTwHit(sub,eta,ener1,outSec->Pre1Hits);
151 addTwHit(sub,eta,ener2,outSec->Pre2Hits);
154 addTwHit(sub,eta,ener14,outSec->TwHits);
157 addTwHit(sub,eta,ener4,outSec->PostHits);
169 addSmdHit(strip,ener,outSec->SmdUHits);
174 addSmdHit(strip,ener,outSec->SmdVHits);
185 void EEsectorDst::sumRawMCtw(TClonesArray *inH,
float* sum,
int mx) {
189 for(j=0;j<mx;j++) sum[j]=0;
194 for(ih=0;ih<inH->GetEntries();ih++) {
200 hit->get(sub,eta,ener);
205 int index=(sub-
'A')*12+ (eta-1);
206 assert(index>=0 && index<mx);
216 void EEsectorDst::sumRawMCsmd(TClonesArray *inH,
float* sum,
int mx) {
219 for(j=0;j<mx;j++) sum[j]=0;
223 for(ih=0;ih<inH->GetEntries();ih++) {
228 hit->get(strip,ener);
233 assert(index>=0 && index<mx);