File indexing completed on 2025-01-18 10:18:21
0001
0002
0003
0004
0005
0006
0007
0008 void hit_map_ftbf_1x1(const char *dfname, const char *cfname = 0)
0009 {
0010 auto fcfg = new TFile(cfname ? cfname : dfname);
0011 auto geometry = dynamic_cast<CherenkovDetectorCollection*>(fcfg->Get("CherenkovDetectorCollection"));
0012 auto fdata = new TFile(dfname);
0013 TTree *t = dynamic_cast<TTree*>(fdata->Get("t"));
0014 auto event = new CherenkovEvent();
0015 t->SetBranchAddress("e", &event);
0016
0017 int nEvents = t->GetEntries();
0018
0019 unsigned dim = 32;
0020 double pitch = 3.25, size = dim*pitch;
0021 auto hxy = new TH2D("hxy", "", dim, -size/2, size/2, dim, -size/2, size/2);
0022
0023 for(unsigned ev=0; ev<nEvents; ev++) {
0024 t->GetEntry(ev);
0025
0026 for(auto particle: event->ChargedParticles()) {
0027
0028 for(auto rhistory: particle->GetRadiatorHistory()) {
0029 auto history = particle->GetHistory (rhistory);
0030
0031 for(auto photon: history->Photons()) {
0032 if (!photon->WasDetected() ) continue;
0033
0034 TVector3 phx = photon->GetDetectionPosition();
0035
0036 if (phx.Z() > -1000) hxy->Fill(phx.X(), phx.Y());
0037 }
0038 }
0039 }
0040 }
0041
0042 gStyle->SetOptStat(0);
0043 auto cv = new TCanvas("cv", "", 1000, 1000);
0044 hxy->GetXaxis()->SetTitle("Sensor plane X, [mm]");
0045 hxy->GetYaxis()->SetTitle("Sensor plane Y, [mm]");
0046 hxy->GetXaxis()->SetTitleOffset(1.20);
0047 hxy->GetYaxis()->SetTitleOffset(1.40);
0048
0049
0050 hxy->Draw("COL");
0051 }