CountProton.C
Go to the documentation of this file.
1 #include <string>
2 
3 
4 void CountProton()
5 {
6 
7  // input filename of histogram file created from running ReMIdTrain_module.cc
8  const std::string filename = "../remidstudies_hist.root";
9 
10 
11  TChain* dedxch = new TChain("remiddedxstudies/fProtonDedxSample");
12 
13  // Add file to the signal dedx chain
14  dedxch->Add((filename).c_str());
15 
16  //SL - removing extra start / end cuts
17  TCut cutSDedx = "ProtonzEnd < 1200";
18 
19  /* vertex out of dedx region will not be used, only use contained tracks*/
20  TCut UsedNonVert = "Protonvert == 0 && Protonused == 1";
21  TCut Pass = "passOffTrackHits == 1 && passOffTrackEnergy == 1 && passHadEOnMuonTrack == 1 && passVertX == 1 && passVertY == 1 && passVertZ == 1 && passProtonRemid == 1 && passDedxRatio == 1 && passEDiffZTest == 1";
22 
23  TCut trueProton = "trueNumuCCWithProton == 1";
24 
25  // Create dEdx histograms
26  TH2F* DedxVx = new TH2F("DedxVx",";Distance from End of Track (cm); dE/dx (GeV/cm)",
27  1500, 0, 1500, 10, 0, 10);
28 
29  // Draw signal dedx v x histogram
30  TCanvas* c1 = new TCanvas("c1","c1");
31  //SL - changing cut to get rid of endpoint cut
32  //dedxch->Draw("Protondedx:ProtondistFromEnd>>DedxVx",cutSDedx&&UsedNonVert,"colz");
33 // dedxch->Draw("Protondedx:ProtondistFromEnd>>DedxVx",UsedNonVert&&Pass,"colz");
34  dedxch->Draw("Protondedx:ProtondistFromEnd>>DedxVx","","colz");
35 
36  std::cout<<"Proton track number: "<<DedxVx->Integral()<<std::endl;
37 
38  DedxVx = new TH2F("DedxVx",";Distance from End of Track (cm); dE/dx (GeV/cm)",
39  1500, 0, 1500, 10, 0, 10);
40  dedxch->Draw("Protondedx:ProtondistFromEnd>>DedxVx",trueProton, "colz");
41  std::cout<<"Proton track number: "<<DedxVx->Integral()<<std::endl;
42 
43  DedxVx->SaveAs("mcdedxVxFineSAProtonBirksC.root");
44 
45 }
void CountProton()
Definition: CountProton.C:4
string filename
Definition: shutoffs.py:106
OStream cout
Definition: OStream.cxx:6
c1
Definition: demo5.py:24
accept
Definition: HLTenums.h:16
enum BeamMode string