Skip to content

Commit eedcb5a

Browse files
committed
test: incidence angle hist added
1 parent ffd9b46 commit eedcb5a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/test_pixel_gap_cuts.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <edm4eic/MCRecoTrackerHitAssociationCollection.h>
1515

1616
#include <services/geometry/richgeo/ReadoutGeo.h>
17+
#include <services/geometry/richgeo/IrtGeoDRICH.h>
1718

1819
int main(int argc, char** argv) {
1920

@@ -57,8 +58,9 @@ int main(int argc, char** argv) {
5758
const std::string tree_name = "events";
5859

5960
// local hits histogram
61+
double pi = TMath::Pi();
6062
auto h = new TH2D("h","local MC SiPM hits",10000,-15,15,10000,-15,15);
61-
63+
auto h1 = new TH1D("h1","Photon Incidence angle; rad",1000,-pi,pi);
6264
// event loop
6365
for(unsigned e=0; e<reader.getEntries(tree_name); e++) {
6466
logger->trace("EVENT {}", e);
@@ -72,7 +74,12 @@ int main(int argc, char** argv) {
7274

7375
auto cellID = sim_hit.getCellID();
7476
auto pos = sim_hit.getPosition();
77+
auto mom = sim_hit.getMomentum();
78+
TVector3 p; p.SetX(mom.x); p.SetY(mom.y); p.SetZ(mom.z);
7579
auto normZ = drichGeo.GetSensorSurface(cellID);
80+
81+
double angle = normZ.Dot(p.Unit());
82+
h1->Fill(angle);
7683
dd4hep::Position pos_global(pos.x*dd4hep::mm, pos.y*dd4hep::mm, pos.z*dd4hep::mm);
7784
auto pos_local = geo.GetSensorLocalPosition(cellID, pos_global);
7885
h->Fill(pos_local.y()/dd4hep::mm, pos_local.x()/dd4hep::mm);
@@ -93,8 +100,9 @@ int main(int argc, char** argv) {
93100
}
94101

95102
gStyle->SetOptStat(0);
96-
auto c = new TCanvas();
97-
h->Draw();
103+
auto c = new TCanvas(); c->Divide(2,1);
104+
c->cd(1);h->Draw();
105+
c->cd(2);h1->Draw();
98106
fmt::print("NUMBER OF DIGITIZED PHOTONS: {}\n", h->GetEntries());
99107
if(interactiveOn) {
100108
fmt::print("\n\npress ^C to exit.\n\n");

0 commit comments

Comments
 (0)