Skip to content

Commit cd0356f

Browse files
committed
Impinging angle [0,90] degrees
1 parent eedcb5a commit cd0356f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/test_pixel_gap_cuts.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main(int argc, char** argv) {
6060
// local hits histogram
6161
double pi = TMath::Pi();
6262
auto h = new TH2D("h","local MC SiPM hits",10000,-15,15,10000,-15,15);
63-
auto h1 = new TH1D("h1","Photon Incidence angle; rad",1000,-pi,pi);
63+
auto h1 = new TH1D("h1","Photon Incidence angle; degrees",180,0,90);
6464
// event loop
6565
for(unsigned e=0; e<reader.getEntries(tree_name); e++) {
6666
logger->trace("EVENT {}", e);
@@ -78,8 +78,9 @@ int main(int argc, char** argv) {
7878
TVector3 p; p.SetX(mom.x); p.SetY(mom.y); p.SetZ(mom.z);
7979
auto normZ = drichGeo.GetSensorSurface(cellID);
8080

81-
double angle = normZ.Dot(p.Unit());
82-
h1->Fill(angle);
81+
double cosAng = (normZ.Unit()).Dot(p.Unit());
82+
double angle = pi- acos(cosAng);
83+
h1->Fill(angle*(180/pi));
8384
dd4hep::Position pos_global(pos.x*dd4hep::mm, pos.y*dd4hep::mm, pos.z*dd4hep::mm);
8485
auto pos_local = geo.GetSensorLocalPosition(cellID, pos_global);
8586
h->Fill(pos_local.y()/dd4hep::mm, pos_local.x()/dd4hep::mm);
@@ -102,7 +103,7 @@ int main(int argc, char** argv) {
102103
gStyle->SetOptStat(0);
103104
auto c = new TCanvas(); c->Divide(2,1);
104105
c->cd(1);h->Draw();
105-
c->cd(2);h1->Draw();
106+
c->cd(2);gPad->SetLogy();h1->Draw();
106107
fmt::print("NUMBER OF DIGITIZED PHOTONS: {}\n", h->GetEntries());
107108
if(interactiveOn) {
108109
fmt::print("\n\npress ^C to exit.\n\n");

0 commit comments

Comments
 (0)