13 #include <JANA/JApplication.h>
14 #include <JANA/JFactory.h>
46 TDirectory *
main = gDirectory;
47 gDirectory->mkdir(
"CDC_amp")->cd();
49 time =
new TH1I(
"time",
"CDC time (hits on tracks); raw time",200,0,2000);
51 a =
new TH1I(
"a",
"CDC amplitude (hits on tracks);amplitude - pedestal",4096,0,4096);
53 an =
new TH2I(
"an",
"CDC amplitude vs n (hits on tracks); n; amplitude - pedestal",3522,0,3522,4096,0,4096);
55 atime =
new TH2D(
"atime",
"CDC amplitude vs time (hits on tracks); raw time; amplitude - pedestal",200,0,2000,4096,0,4096);
57 atheta =
new TH2D(
"atheta",
"CDC amplitude vs theta (hits on tracks); theta; amplitude - pedestal",180,0,180,4096,0,4096);
60 a30 =
new TH1I(
"a30",
"CDC amplitude (tracks, theta 28-32 deg, z 52-78cm);amplitude - pedestal",4096,0,4096);
62 a30_100ns =
new TH1I(
"a30_100ns",
"CDC amplitude, hits with drift time < 100ns (tracks, theta 28-32 deg, z 52-78cm);amplitude - pedestal",4096,0,4096);
64 an30_100ns =
new TH2I(
"an30_100ns",
"CDC amplitude vs n, hits with drift time < 100ns (tracks, theta 28-32 deg, z 52-78cm); n; amplitude - pedestal",3522,0,3522,4096,0,4096);
66 atime30 =
new TH2D(
"atime30",
"CDC amplitude vs time (tracks, theta 28-32 deg, z 52-78cm); raw time; amplitude - pedestal",200,0,2000,4096,0,4096);
68 adoca30 =
new TH2D(
"adoca30",
"CDC amplitude vs DOCA (tracks, theta 28-32 deg, z 52-78cm); DOCA (cm); amplitude - pedestal",200,0,1.0,4096,0,4096);
72 a45 =
new TH1I(
"a45",
"CDC amplitude (tracks, theta 43-47 deg, z 52-78cm);amplitude - pedestal",4096,0,4096);
74 a45_100ns =
new TH1I(
"a45_100ns",
"CDC amplitude, hits with drift time < 100ns (tracks, theta 43-47 deg, z 52-78cm); amplitude - pedestal",4096,0,4096);
76 an45_100ns =
new TH2I(
"an45_100ns",
"CDC amplitude vs n, hits with drift time < 100ns (tracks, theta 43-47 deg, z 52-78cm); n; amplitude - pedestal",3522,0,3522,4096,0,4096);
78 atime45 =
new TH2D(
"atime45",
"CDC amplitude vs time (tracks, theta 43-47 deg, z 52-78cm); raw time; amplitude - pedestal",200,0,2000,4096,0,4096);
80 adoca45 =
new TH2D(
"adoca45",
"CDC amplitude vs DOCA (tracks, theta 43-47 deg, z 52-78cm); DOCA (cm); amplitude - pedestal",200,0,1.0,4096,0,4096);
87 a90 =
new TH1I(
"a90",
"CDC amplitude (tracks, theta 85-95 deg, z 52-78cm);amplitude - pedestal",4096,0,4096);
89 a90_100ns =
new TH1I(
"a90_100ns",
"CDC amplitude, hits with drift time < 100ns (tracks, theta 85-95 deg, z 52-78cm);amplitude - pedestal",4096,0,4096);
91 an90_100ns =
new TH2I(
"an90_100ns",
"CDC amplitude vs n, hits with drift time < 100ns (tracks, theta 85-95 deg, z 52-78cm); n; amplitude - pedestal",3522,0,3522,4096,0,4096);
93 atime90 =
new TH2D(
"atime90",
"CDC amplitude vs time (tracks, theta 85-95 deg, z 52-78cm); raw time; amplitude - pedestal",200,0,2000,4096,0,4096);
95 adoca90 =
new TH2D(
"adoca90",
"CDC amplitude vs DOCA (tracks, theta 85-95 deg, z 52-78cm); DOCA (cm); amplitude - pedestal",200,0,1.0,4096,0,4096);
97 time90 =
new TH1I(
"time90",
"CDC time (tracks, theta 85-95 deg, z 52-78cm); raw time",200,0,2000);
99 an90 =
new TH2I(
"an90",
"CDC amplitude vs n (tracks, theta 85-95 deg, z 52-78cm); n; amplitude - pedestal",3522,0,3522,4096,0,4096);
101 xt90 =
new TH2D(
"xt90",
"CDC DOCA vs time (tracks, theta 85-95 deg, z 52-78cm); time (ns); DOCA (cm)",400,0,1200,400,0,1.0);
116 if (runnumber<40000)
ASCALE = 8;
118 if (runnumber>41497)
ASCALE = 8;
151 int straw_offset[29] = {0,0,42,84,138,192,258,324,404,484,577,670,776,882,1005,1128,1263,1398,1544,1690,1848,2006,2176,2346,2528,2710,2907,3104,3313};
156 loop->GetSingle(locTrigger);
161 const DVertex* locVertex = NULL;
162 loop->GetSingle(locVertex);
164 if (vertexz < 52 || vertexz > 78)
return NOERROR;
182 int used[3523] = {0};
187 vector<const DTrackTimeBased*> tracks;
192 for (uint32_t i=0; i<tracks.size(); i++) {
194 DVector3 mom = tracks[i]->momentum();
195 double theta = mom.Theta();
196 theta = 180.0*theta/3.14159;
198 vector<DTrackFitter::pull_t> pulls = tracks[i]->pulls;
200 for (uint32_t j=0; j<pulls.size(); j++) {
202 if (pulls[j].
cdc_hit == NULL)
continue;
205 pulls[j].cdc_hit->GetSingle(hit);
207 double doca = pulls[j].d;
208 double tdrift = pulls[j].tdrift;
215 hit->GetSingle(digihit);
216 if (!digihit)
continue;
219 digihit->GetSingle(cp);
231 netamp = (int)amp - (
int)scaledped;
235 if (netamp ==0)
continue;
237 ring = (int)hit->
ring;
238 straw = (
int)hit->
straw;
240 n = straw_offset[ring] + straw;
243 japp->RootFillLock(
this);
251 atheta->Fill(theta,netamp);
252 atime->Fill((
int)t,netamp);
255 if ((theta>85) && (theta<95)) {
264 an90->Fill(n,netamp);
266 xt90->Fill(tdrift,doca);
268 }
else if ((theta > 28.05) && (theta < 32)) {
277 }
else if ((theta > 43.07) && (theta < 47)) {
292 japp->RootFillUnLock(
this);
uint32_t first_max_amp
from second word
~JEventProcessor_CDC_amp()
jerror_t fini(void)
Called after last event of last event source has been processed.
uint32_t pedestal
from second word
uint32_t Get_L1FrontPanelTriggerBits(void) const
uint32_t overflow_count
from first word
uint32_t le_time
from first word
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
uint32_t time_quality_bit
from first word
DLorentzVector dSpacetimeVertex
void cdc_hit(Int_t &, Int_t &, Int_t &, Int_t[], Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
JEventProcessor_CDC_amp()
int main(int argc, char *argv[])