31 {
32 MsgStream log(
msgSvc(), name() );
33 log << MSG::INFO << "DedxSaveWireGain::FillHists()" << endmsg;
34 int run, evt;
35 double gain;
36 m_wiregain->Branch( "run", &run, "run/I" );
37 m_wiregain->Branch( "evt", &evt, "evt/I" );
38 m_wiregain->Branch( "gain", &gain, "gain/D" );
39
41 TTree* n102;
42 string runlist;
43
44 double dedx = 0;
45 float runNO = 0, evtNO = 0, runFlag = 0, pathlength = 0, wid = 0, layid = 0, dd_in = 0,
46 driftdist = 0, eangle = 0, zhit = 0, costheta = 0, tes = 0, ptrk = 0;
49 {
51 cout << "runlist: " << runlist.c_str() << endl;
52 f =
new TFile( runlist.c_str() );
53 n102 = (TTree*)
f->Get(
"n102" );
54 n102->SetBranchAddress( "adc_raw", &dedx );
55 n102->SetBranchAddress( "path_rphi", &pathlength );
56 n102->SetBranchAddress( "wire", &wid );
57 n102->SetBranchAddress( "layer", &layid );
58 n102->SetBranchAddress( "doca_in", &dd_in );
59 n102->SetBranchAddress( "driftdist", &driftdist );
60 n102->SetBranchAddress( "eangle", &eangle );
61 n102->SetBranchAddress( "zhit", &zhit );
62 n102->SetBranchAddress( "runNO", &runNO );
63 n102->SetBranchAddress( "evtNO", &evtNO );
64 n102->SetBranchAddress( "runFlag", &runFlag );
65 n102->SetBranchAddress( "costheta1", &costheta );
66 n102->SetBranchAddress( "t01", &tes );
67 n102->SetBranchAddress( "ptrk1", &ptrk );
68
69 cout << "entries in this file" << n102->GetEntries() << endl;
70 for ( int j = 0; j < n102->GetEntries(); j++ )
71 {
72 n102->GetEntry( j );
73 if ( tes > 1400 ) continue;
74 if ( ptrk > pMax || ptrk < pMin ) continue;
75 if ( layid < 8 )
76 {
79 continue;
80 }
81 else
82 {
85 continue;
86 }
87 dedx =
exsvc->StandardHitCorrec( 0, runFlag, 2, runNO, evtNO, pathlength, wid, layid,
88 dedx, dd_in, eangle, costheta );
89 dedx =
exsvc->StandardTrackCorrec( 0, runFlag, 2, runNO, evtNO, dedx, costheta, tes );
90 run = (int)runNO;
91 evt = (int)evtNO;
92 gain = dedx;
93
94 m_wiregain->Fill();
95 }
96 }
97}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
#define Iner_DriftDistCut
vector< string > m_recFileVector