Skip to content

Commit

Permalink
Merge branch 'Run2HSCP_v8' of https://github.com/quertenmont/cmssw in…
Browse files Browse the repository at this point in the history
…to Run2HSCP_MyBranchName
  • Loading branch information
quertenmont committed Jul 28, 2015
2 parents 6747704 + 9e4cfac commit e0781b9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
8 changes: 4 additions & 4 deletions SUSYBSMAnalysis/HSCP/test/AnalysisCode/Analysis_Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ std::string dEdxS_Legend = "I_{as}";
std::string dEdxM_Label = "dedxHarm2";
double dEdxM_UpLim = 30.0;
std::string dEdxM_Legend = "I_{h} (MeV/cm)";
double dEdxK_Data = 2.529;
double dEdxC_Data = 2.772;
double dEdxK_MC = 2.529;
double dEdxC_MC = 2.772;
double dEdxK_Data = 2.779;
double dEdxC_Data = 2.879;
double dEdxK_MC = 2.683;
double dEdxC_MC = 2.453;

// TOF object to be used for combined, DT and CSC TOF measurement
std::string TOF_Label = "combined";
Expand Down
27 changes: 24 additions & 3 deletions SUSYBSMAnalysis/HSCP/test/UsefulScripts/DeDxStudy/DeDxStudy.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ using namespace trigger;


#include "../../AnalysisCode/Analysis_Step1_EventLoop.C"
#include "DataFormats/SiStripDetId/interface/SiStripDetId.h"


#endif
Expand Down Expand Up @@ -94,6 +95,17 @@ void DeDxStudy(string DIRNAME="COMPILE", string INPUT="dEdx.root", string OUTPUT
}

//system("mkdir -p pictures/");
double P_Min = 1;
double P_Max = 15;
int P_NBins = 14 ;
double Path_Min = 0.2 ;
double Path_Max = 1.6 ;
int Path_NBins = 42 ;
double Charge_Min = 0 ;
double Charge_Max = 5000;
int Charge_NBins = 500 ;

TH3D* Charge_Vs_Path = new TH3D ("Charge_Vs_Path" , "Charge_Vs_Path" , P_NBins, P_Min, P_Max, Path_NBins, Path_Min, Path_Max, Charge_NBins, Charge_Min, Charge_Max);

TFile* OutputHisto = new TFile((OUTPUT).c_str(),"RECREATE");

Expand Down Expand Up @@ -143,10 +155,14 @@ void DeDxStudy(string DIRNAME="COMPILE", string INPUT="dEdx.root", string OUTPUT
if(!dedxCollH.isValid()){printf("Invalid dedxCollH\n");continue;}

fwlite::Handle< std::vector<reco::Track> > trackCollHandle;
// trackCollHandle.getByLabel(ev,"generalTracks");
trackCollHandle.getByLabel(ev,"RefitterForDeDx");
if(!trackCollHandle.isValid()){printf("Invalid trackCollHandle\n");continue;}

if(!trackCollHandle.isValid()){
trackCollHandle.getByLabel(ev,"generalTracks");
if (!trackCollHandle.isValid()){
printf("Invalid trackCollHandle\n");
continue;
}
}


for(unsigned int c=0;c<trackCollHandle->size();c++){
Expand All @@ -172,6 +188,10 @@ void DeDxStudy(string DIRNAME="COMPILE", string INPUT="dEdx.root", string OUTPUT
double Norm = (detid.subdetId()<3)?3.61e-06:3.61e-06*265;
double ChargeOverPathlength = scaleFactor*Norm*dedxHits->charge(h)/dedxHits->pathlength(h);

SiStripDetId SSdetId(detid);
if (track->p() > 5) Charge_Vs_Path->Fill (SSdetId.moduleGeometry(),
dedxHits->pathlength(h)*10,
dedxHits->charge(h)/(dedxHits->pathlength(h)*10));
HHit->Fill(ChargeOverPathlength);
}

Expand Down Expand Up @@ -220,6 +240,7 @@ void DeDxStudy(string DIRNAME="COMPILE", string INPUT="dEdx.root", string OUTPUT

}

Charge_Vs_Path->SaveAs(("ChargeVsPath"+OUTPUT).c_str());
OutputHisto->Write();
OutputHisto->Close();
}

0 comments on commit e0781b9

Please sign in to comment.