From 72b1d7f9760c9f975344742c7d7fc3e0750ec077 Mon Sep 17 00:00:00 2001 From: adrien matta <matta@lpccaen.in2p3.fr> Date: Fri, 24 Jul 2020 18:35:14 +0200 Subject: [PATCH] * progress on shift macro --- Projects/Strasse/Analysis.cxx | 11 ++++++++--- Projects/Strasse/Analysis.h | 2 ++ Projects/Strasse/macro/Shift.cxx | 12 +++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Projects/Strasse/Analysis.cxx b/Projects/Strasse/Analysis.cxx index 6d3dabf82..c58c88c9b 100644 --- a/Projects/Strasse/Analysis.cxx +++ b/Projects/Strasse/Analysis.cxx @@ -8,7 +8,7 @@ /***************************************************************************** * Original Author: Adrien MATTA contact address: a.matta@surrey.ac.uk * * * - * Creation Date : march 2012 * + * Creation Date : july 2020 * * Last update : * *---------------------------------------------------------------------------* * Decription: * @@ -75,8 +75,8 @@ void Analysis::TreatEvent(){ TVector3 OuterPos2 = Strasse->GetOuterPositionOfInteraction(1); TVector3 Proton2 = OuterPos2-InnerPos2; - double deltaPhi = abs(Proton1.Phi()/deg-Proton2.Phi()/deg); - double sumTheta = Proton1.Theta()/deg+Proton2.Theta()/deg; + deltaPhi = abs(Proton1.Phi()/deg-Proton2.Phi()/deg); + sumTheta = Proton1.Theta()/deg+Proton2.Theta()/deg; Theta12 = Proton1.Angle(Proton2)/deg; // reject event that make no physical sense @@ -136,6 +136,9 @@ void Analysis::InitOutputBranch() { RootOutput::getInstance()->GetTree()->Branch("deltaX",&deltaX,"deltaX/D"); RootOutput::getInstance()->GetTree()->Branch("deltaY",&deltaY,"deltaY/D"); RootOutput::getInstance()->GetTree()->Branch("deltaZ",&deltaZ,"deltaZ/D"); + RootOutput::getInstance()->GetTree()->Branch("deltaPhi",&deltaPhi,"deltaPhi/D"); + RootOutput::getInstance()->GetTree()->Branch("sumTheta",&sumTheta,"sumTheta/D"); + RootOutput::getInstance()->GetTree()->Branch("Distance",&Distance,"Distance/D"); RootOutput::getInstance()->GetTree()->Branch("InteractionCoordinates","TInteractionCoordinates",&DC); @@ -160,6 +163,8 @@ void Analysis::ReInitValue(){ deltaY=-1000; deltaZ=-1000; Distance=-1000; + sumTheta=-1000; + deltaPhi=-1000; } diff --git a/Projects/Strasse/Analysis.h b/Projects/Strasse/Analysis.h index c6561c0a4..8092e2804 100644 --- a/Projects/Strasse/Analysis.h +++ b/Projects/Strasse/Analysis.h @@ -62,6 +62,8 @@ class Analysis: public NPL::VAnalysis{ double deltaY; double deltaZ; double Distance; + double deltaPhi; + double sumTheta; TLorentzVector LV_A; TLorentzVector LV_T; TLorentzVector LV_B; diff --git a/Projects/Strasse/macro/Shift.cxx b/Projects/Strasse/macro/Shift.cxx index 057b95256..235948643 100644 --- a/Projects/Strasse/macro/Shift.cxx +++ b/Projects/Strasse/macro/Shift.cxx @@ -3,12 +3,22 @@ void Shift(){ TFile* file_shifted = TFile::Open("../../Outputs/Analysis/strasse_shifted.root"); TTree* ok= (TTree*) file_ok->FindObjectAny("PhysicsTree"); TTree* shifted= (TTree*) file_shifted->FindObjectAny("PhysicsTree"); - TCanvas* ctheta= new TCanvas("ControlTheta","ControlTheta",1000,1000); + TCanvas* ctheta= new TCanvas("ControlTheta","ControlTheta",2000,1000); + ctheta->Divide(2,1); + ctheta->cd(1); string cond = "Theta12!=-1000"; ok->Draw("Theta12>>ht(5000)",cond.c_str(),"") ; shifted->Draw("Theta12>>hts(5000)",cond.c_str(),"same") ; TH1* hts= (TH1*) gDirectory->FindObjectAny("hts"); hts->SetFillColor(kOrange-3); hts->SetLineColor(kOrange-3); + ctheta->cd(2); + cond = "deltaPhi!=-1000"; + ok->Draw("deltaPhi>>hp(5000)",cond.c_str(),"") ; + shifted->Draw("deltaPhi>>hps(5000)",cond.c_str(),"same") ; + TH1* hps= (TH1*) gDirectory->FindObjectAny("hps"); + hps->SetFillColor(kOrange-3); + hps->SetLineColor(kOrange-3); + } -- GitLab