From fb18434d982fb0982e9bb463a91c6424a452469f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 17 Sep 2020 16:29:21 -0500 Subject: [PATCH 01/15] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8389989..7cbd5e9 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ -# dt_analysis_code \ No newline at end of file +# dt_analysis_code + +
+cmsrel CMSSW_10_2_18
+cd CMSSW_10_2_18
+cd src
+cmsenv
+git cms-init
+git clone git@github.com:dildick/dt_analysis_code.git
+
From cbba0e42375669b1e42aeccede2ba690c6841fa8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 25 Sep 2020 10:26:54 -0500 Subject: [PATCH 02/15] first commit --- analyzeSignal.C | 2309 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2309 insertions(+) create mode 100644 analyzeSignal.C diff --git a/analyzeSignal.C b/analyzeSignal.C new file mode 100644 index 0000000..8bb29cc --- /dev/null +++ b/analyzeSignal.C @@ -0,0 +1,2309 @@ +R__LOAD_LIBRARY(libTreePlayer) + +int getStation(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 400. && hitR < 480.){ return 1; } + else if(hitR > 485. && hitR < 560.){ return 2; } + else if(hitR > 590. && hitR < 650.){ return 3; } + else if(hitR > 690. && hitR < 800.){ return 4; } + else{ return -1; } +} + +int getWheel(float hitZ){ + if(hitZ > 0){ + if(hitZ < 127.){ return 0; } + else if(hitZ < 395.){ return 1; } + else if(hitZ < 661.){ return 2; } + else{ return -99; } + } + else{ + return -1*getWheel(-1.0*hitZ); + } +} + +int getRPCLayer(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 410. && hitR < 440.){ return 1; } + else if(hitR > 445. && hitR < 475.){ return 2; } + else if(hitR > 490. && hitR < 520.){ return 3; } + else if(hitR > 525. && hitR < 555.){ return 4; } + else if(hitR > 600. && hitR < 630.){ return 5; } + else if(hitR > 700. && hitR < 770.){ return 6; } + else{ return -1; } +} + +void analyzeSignal(){ + + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; + } + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; + } + + char name[50]; + char title[100]; + char mX[3][10] = {"15","40","55"}; + //char mX[2][10] = {"25","450"}; + //char ctau[10] = "1m"; + char ctau[10] = "10000"; + char years[3][10] = {"2018","2017","2016"}; + char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; + char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); + for(Int_t itr_year=0; itr_year < 3; itr_year++){ + TFile *_file; + _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_" + + runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); + + //TString dir("/storage/user/mcitron/signalPointsGGHWithRPCWithFlags/"); + //TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + // TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + + + /* + data files + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + + 2016 data for ex: /mnt/hadoop/store/group/phys_exotica/delayedjets/disp +lacedJetMuonAnalyzer/driftTube/V1p17/Data2016/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root + + + */ + TFile *_ofile = TFile::Open("outSig_central_V1p17.root","RECREATE"); + Float_t lumi[3] = {37.8,44.98,63.67}; + Float_t xSec = 48.58; + Float_t weight; + + TH1D *h_dPhiClusterMET[4]; + TH1D *h_dPhiClusterMETMax[4]; + TH1D *h_dPhiJetMET[4]; + TH1D *h_jetMet_dPhiMin4[4]; + TH1D *h_MET[4]; + TH1D *h_jetPt[4]; + + TH1D *h_dPhiJetMETBarrel_noVeto[4]; + TH1D *h_dPhiJetMETBarrel_jetVeto[4]; + TH1D *h_dPhiJetMETBarrel_muonVeto[4]; + TH1D *h_dPhiJetMETBarrel_MB1Veto[4]; + TH1D *h_dPhiJetMETBarrel_noMB1Veto[4]; + TH1D *h_dPhiJetMETBarrel_fullVeto[4]; + TH1D *h_dPhiJetMETMagnet_noVeto[4]; + TH1D *h_dPhiJetMETMagnet_jetVeto[4]; + TH1D *h_dPhiJetMETMagnet_muonVeto[4]; + TH1D *h_dPhiJetMETMagnet_MB1Veto[4]; + TH1D *h_dPhiJetMETMagnet_noMB1Veto[4]; + TH1D *h_dPhiJetMETMagnet_fullVeto[4]; + TH1D *h_dPhiJetMETMagnet_fullHOVeto[4]; + TH1D *h_dPhiJetMETMagnet[4]; + TH1D *h_dPhiJetMETAll_noVeto[4]; + TH1D *h_dPhiJetMETAll_jetVeto[4]; + TH1D *h_dPhiJetMETAll_muonVeto[4]; + TH1D *h_dPhiJetMETAll_MB1Veto[4]; + TH1D *h_dPhiJetMETAll_noMB1Veto[4]; + TH1D *h_dPhiJetMETAll_fullVeto[4]; + + TH1D *h_nDtRechitClusters_noVeto[4]; + TH1D *h_dtRechitClusterSize_noVeto[4]; + TH1D *h_nTotalClusteredRechits_noVeto[4]; + TH1D *h_dtRechitClusterMaxStation_noVeto[4]; + TH1D *h_dtRechitClusterNStation_noVeto[4]; + TH1D *h_dPhiClusterMET_noVeto[4]; + TH1D *h_dtRechitClusterXSpread_noVeto[4]; + TH1D *h_dtRechitClusterYSpread_noVeto[4]; + TH1D *h_dtRechitClusterZSpread_noVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_noVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_noVeto[4]; + TH1D *h_nRPCMatched_noVeto[4]; + TH1D *h_RPCMatchedBx_noVeto[4]; + TH1D *h_RPCMatchedBxSpread_noVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_noVeto[4]; + TH1D *h_nRPCMatched_Spread0_noVeto[4]; + TH2D *h_npv_nDtRechitClusters_noVeto[4]; + + TH1D *h_nDtRechitClusters_muonVeto[4]; + TH1D *h_dtRechitClusterSize_muonVeto[4]; + TH1D *h_nTotalClusteredRechits_muonVeto[4]; + TH1D *h_dtRechitClusterMaxStation_muonVeto[4]; + TH1D *h_dtRechitClusterNStation_muonVeto[4]; + TH1D *h_dPhiClusterMET_muonVeto[4]; + TH1D *h_dtRechitClusterXSpread_muonVeto[4]; + TH1D *h_dtRechitClusterYSpread_muonVeto[4]; + TH1D *h_dtRechitClusterZSpread_muonVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_muonVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_muonVeto[4]; + TH1D *h_nRPCMatched_muonVeto[4]; + TH1D *h_RPCMatchedBx_muonVeto[4]; + TH1D *h_RPCMatchedBxSpread_muonVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; + TH1D *h_nRPCMatched_Spread0_muonVeto[4]; + + TH1D *h_nDtRechitClusters_jetVeto[4]; + TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; + TH1D *h_dtRechitClusterSizeAll_jetVeto[4]; + TH1D *h_dtRechitClusterSize_jetVeto[4]; + TH1D *h_nTotalClusteredRechits_jetVeto[4]; + TH1D *h_dtRechitClusterMaxStation_jetVeto[4]; + TH1D *h_dtRechitClusterNStation_jetVeto[4]; + TH1D *h_dPhiClusterMET_jetVeto[4]; + TH1D *h_dtRechitClusterXSpread_jetVeto[4]; + TH1D *h_dtRechitClusterYSpread_jetVeto[4]; + TH1D *h_dtRechitClusterZSpread_jetVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_jetVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_jetVeto[4]; + TH1D *h_nRPCMatched_jetVeto[4]; + TH1D *h_nRPCMatchedMagnet_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer1_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer2_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer3_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer4_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer1_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer2_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer3_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer4_fullHOVeto[4]; + TH1D *h_RPCMatchedBx_jetVeto[4]; + TH1D *h_RPCMatchedBxSpread_jetVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_jetVeto[4]; + TH1D *h_nRPCMatched_Spread0_jetVeto[4]; + + TH1D *h_nDtRechitClusters_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeBarrel_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeMagnet_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeAll_MB1Veto[4]; + TH1D *h_dtRechitClusterSize_MB1Veto[4]; + TH1D *h_nTotalClusteredRechits_MB1Veto[4]; + TH1D *h_dtRechitClusterMaxStation_MB1Veto[4]; + TH1D *h_dtRechitClusterNStation_MB1Veto[4]; + TH1D *h_dPhiClusterMET_MB1Veto[4]; + TH1D *h_dtRechitClusterXSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterYSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterZSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterEtaSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterPhiSpread_MB1Veto[4]; + TH1D *h_nRPCMatched_MB1Veto[4]; + TH1D *h_RPCMatchedBx_MB1Veto[4]; + TH1D *h_RPCMatchedBxSpread_MB1Veto[4]; + TH1D *h_nRPCMatched_Spread0_MB1Veto[4]; + TH1D *h_RPCMatchedBx_Spread0_MB1Veto[4]; + + TH1D *h_nDtRechitClusters_fullVeto[4]; + TH1D *h_dtRechitClusterSizeBarrel_fullVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_fullVeto[4]; + TH1D *h_dtRechitClusterSizeAll_fullVeto[4]; + TH1D *h_dtRechitClusterSize_fullVeto[4]; + TH1D *h_nTotalClusteredRechits_fullVeto[4]; + TH1D *h_dtRechitClusterMaxStation_fullVeto[4]; + TH1D *h_dtRechitClusterMaxStation_fullHOVeto[4]; + TH1D *h_dtRechitClusterNStation_fullVeto[4]; + TH1D *h_dPhiClusterMET_fullVeto[4]; + TH1D *h_dPhiClusterMET_fullHOVeto[4]; + TH1D *h_dtRechitClusterXSpread_fullVeto[4]; + TH1D *h_dtRechitClusterYSpread_fullVeto[4]; + TH1D *h_dtRechitClusterZSpread_fullVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_fullVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_fullVeto[4]; + TH1D *h_nRPCMatched_fullVeto[4]; + TH1D *h_nRPCMatched_fullHOVeto[4]; + TH1D *h_RPCMatchedBx_fullVeto[4]; + TH1D *h_RPCMatchedBxSpread_fullVeto[4]; + TH1D *h_RPCMatchedBxSpread_fullHOVeto[4]; + TH1D *h_nRPCMatched_Spread0_fullVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_fullVeto[4]; + + TH1D *h_dtRechitClusterEta_fullVeto[4]; + TH1D *h_dtRechitClusterPhi_fullVeto[4]; + TH1D *h_dtRechitClusterR_fullVeto[4]; + TH1D *h_dtRechitClusterZ_fullVeto[4]; + TH2D *h_dtRechitClusterRZ_fullVeto[4]; + TH2D *h_dtRechitClusterRZFine_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels50_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels25_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels1_fullVeto[4]; + TH1D *h_dtRechitClusterMaxWheel_fullVeto[4]; + TH2D *h_npv_nDtRechitClusters_fullVeto[4]; + TH1D *h_gLLPpt_fullVeto[4]; + TH1D *h_gLLPpt_Bx0_fullVeto[4]; + TH1D *h_gLLPpt_Bx1_fullVeto[4]; + TH1D *h_gLLP_travel_time_fullVeto[4]; + + TH1D *h_RPCMatchedBx_invertedJetVeto[4]; + TH1D *h_RPCMatchedBx_invertedMuonVeto[4]; + TH1D *h_RPCMatchedBx_invertedMuJetVeto[4]; + + TH1D *h_dtRechitClusterSize_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeBarrel_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeMagnet_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeAll_noMB1Veto[4]; + TH1D *h_dtRechitClusterNStation_noMB1Veto[4]; + TH1D *h_dtRechitClusterNRechitsMB1_noMB1Veto[4]; + TH1D *h_dtRechitClusterPercentRechitsMB1_noMB1Veto[4]; + TH1D *h_nRPCMatched_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer1_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer2_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer12_noMB1Veto[4]; + TH1D *h_RPCMatchedBxSpread_noMB1Veto[4]; + + TH1D *h_dtRechitClusterSizeBarrel_HOVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_HOVeto[4]; + TH1D *h_dtRechitClusterSizeAll_HOVeto[4]; + + TH1D *h_dtRechitClusterSizeBarrel_fullHOVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_fullHOVeto[4]; + TH1D *h_dtRechitClusterSizeAll_fullHOVeto[4]; + + TH1D *h_nTotalClusteredRechitsBarrel_noVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_noVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_noVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsAll_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsAll_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullHOVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullHOVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_fullHOVeto[4]; + + TH1D *h_dtRechitClusterSize_RPCMatch[4]; + TH1D *h_dtRechitClusterSize_RPCSpread0[4]; + TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullVetoPlus[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[4]; + TH1D *h_dtRechitClusterXSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterYSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterZSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterEtaSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterPhiSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterEta_fullVetoPlus[4]; + TH1D *h_dtRechitClusterPhi_fullVetoPlus[4]; + TH2D *h_dtRechitClusterEtaPhi_fullVetoPlus[4]; + TH1D *h_dtRechitClusterNStation_fullVetoPlus[4]; + TH1D *h_dtRechitClusterSizeRatio_fullVetoPlus[4]; + TH1D *h_dtRechitClusterSizeRatio_fullVetoMinus[4]; + TH1D *h_dtRechitClusterNWheel_fullVetoPlus[4]; + TH1D *h_dtRechitClusterNStation_fullHOVetoPlus[4]; + TH1D *h_dtRechitClusterNWheel_fullHOVetoPlus[4]; + + TH1D *h_HOMatchedEnergyCluster280Magnet_noMB1Veto[4]; + + TH1D *h_HOTime_fullHOVeto[4]; + + TH1D *h_muonPt_jetMB1Veto[4]; + TH1D *h_jetPt_muonMB1Veto[4]; + TH1D *h_MB1Rechits_jetMuonVeto[4]; + TH1D *h_muonPt_jetHOVeto[4]; + TH1D *h_jetPt_muonHOVeto[4]; + TH1D *h_HOEnergy_jetMuonVeto[4]; + + TH1D *h_muonDR_fullVeto[4]; + TH1D *h_muonDR_RPCMatch[4]; + TH1D *h_muonDR_RPCSpread0[4]; + TH1D *h_jetDR_fullVeto[4]; + TH1D *h_jetDR_RPCMatch[4]; + TH1D *h_jetDR_RPCSpread0[4]; + TH1D *h_muonDR_fullHOVeto[4]; + TH1D *h_muonDR_HORPCMatch[4]; + TH1D *h_muonDR_HORPCSpread0[4]; + TH1D *h_jetDR_fullHOVeto[4]; + TH1D *h_jetDR_HORPCMatch[4]; + TH1D *h_jetDR_HORPCSpread0[4]; + + TH1D *h_decayVertexRadius_noVeto[4]; + TH1D *h_HOEnergy_jetVeto[4]; + TH1D *h_dRClusterRPC_jetVeto[4]; + TH1D *h_dRClusterHO_jetVeto[4]; + + TH1D *h_jetDR_minDR_fullHOVetoPlus[4]; + TH1D *h_jetPt_minDR_fullHOVetoPlus[4]; + TH1D *h_jetEta_minDR_fullHOVetoPlus[4]; + TH1D *h_jetPhi_minDR_fullHOVetoPlus[4]; + TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetDR_minDR_vetoJet[4]; + TH1D *h_jetPt_minDR_vetoJet[4]; + TH1D *h_jetEta_minDR_vetoJet[4]; + TH1D *h_jetPhi_minDR_vetoJet[4]; + TH1D *h_jetChargedEMEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetNeutralEMEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetNeutralHadronEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetChargedHadronEnergyFraction_minDR_vetoJet[4]; + + Double_t dPhi_tmp = 0.0; + Double_t dPhiClusterMET = 0.0; + Double_t dPhiClusterMET_max = 0.0; + Double_t dPhi_min = 999.; + Double_t clustSizeMax = 0.; + Double_t dPhi_clust = 999.; + Double_t jetPt_tmp = 0.0; + Double_t muonPt_max = 0.0; + Double_t muonDR_min = 0.0; + Double_t jetPt_max = 0.0; + Double_t jetDR_min = 0.0; + Int_t jetDR_index = -1; + + vector muStatus = {}; + Double_t dR_tmp = 0.0; + Int_t nMatched = 0; + vector goodStatus = {1,44,51,52,91}; + vector rpcBx = {}; + vector rpcLayer = {}; + vector zWheel = {}; + Int_t rpcSpread = 0; + Float_t rpcMean = 0; + + Int_t evtNum = 0; + Int_t totalNum = 0; + Bool_t goodEvt = false; + Int_t itr_file = 0; + Int_t goodJets = 0; + Bool_t matchJet = false; + Bool_t matchMuon = false; + Int_t match = 0; + Int_t matchLayer1 = 0; + Int_t matchLayer2 = 0; + Int_t matchLayer3 = 0; + Int_t matchLayer4 = 0; + Int_t matchHO = 0; + Float_t sumE = 0.0; + Float_t totalSumE = 0.0; + Float_t weightT = 0.0; + Int_t llp_itr = -1; + + Bool_t passMuon = false; + Bool_t passJet = false; + Bool_t passMB1 = false; + Bool_t passHO = false; + Bool_t passInvertedJet = false; + Bool_t passInvertedMuon = false; + Bool_t passInvertedMuJet = false; + Int_t nPassMuon = 0; + Int_t nPassJet = 0; + Int_t nPassJetMuon = 0; + Int_t nPassMB1 = 0; + Int_t nPassHO = 0; + Int_t nPassFull = 0; + Int_t nPassFullHO = 0; + Int_t nPassNone = 0; + Int_t totalBarrelEvents = 0; + Int_t totalMagnetEvents = 0; + Int_t totalEvents = 0; + Int_t totalClusteredNone = 0; + Int_t totalClusteredNoMB1 = 0; + Int_t totalClusteredJet = 0; + Int_t totalClusteredMB1 = 0; + Int_t totalClusteredHO = 0; + Int_t totalClusteredFull = 0; + Int_t totalClusteredFullHO = 0; + Float_t noEff = 0.0; + Float_t muonEff = 0.0; + Float_t jetEff = 0.0; + Float_t MB1Eff = 0.0; + Float_t HOEff = 0.0; + Float_t fullHOEff = 0.0; + Float_t fullEff = 0.0; + + Bool_t goodDecay = false; + Bool_t magnetDecay = false; + + Bool_t passNoVeto = false; + Bool_t passFullVeto = false; + Bool_t passRPCMatch = false; + Bool_t passRPCSpread = false; + Bool_t passMaxStation = false; + Bool_t passDeltaPhi = false; + Bool_t passFullVeto_ho = false; + Bool_t passRPCMatch_ho = false; + Bool_t passRPCSpread_ho = false; + Bool_t passMaxStation_ho = false; + Bool_t passDeltaPhi_ho = false; + + Float_t nPassMET = 0; + Float_t nPassDTDecay = 0; + Float_t nPassJetMET = 0; + Float_t nPassNoVeto = 0; + Float_t nPassFullVeto = 0; + + Float_t nPassMaxStation = 0; + Float_t nPassDeltaPhi = 0; + Float_t nPassRPCMatch = 0; + Float_t nPassRPCSpread = 0; + + Float_t nPassHODecay = 0; + Float_t nPassNoVeto_ho = 0; + Float_t nPassFullVeto_ho = 0; + Float_t nPassRPCMatch_ho = 0; + Float_t nPassRPCSpread_ho = 0; + Float_t nPassDeltaPhi_ho = 0; + + Int_t totalClusteredFullPlus = 0; + Int_t totalClusteredFullHOPlus = 0; + + cout << "Preparing histograms" << endl; + for(Int_t itr_mX=0; itr_mX<3; itr_mX++){ + sprintf(name,"h_jetMet_dPhiMin4_%s_%s",mX[itr_mX],ctau); + h_jetMet_dPhiMin4[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMET_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMET[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMET_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMETMax_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMETMax[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_MET_%s_%s",mX[itr_mX],ctau); + h_MET[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_jetPt_%s_%s",mX[itr_mX],ctau); + h_jetPt[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nDtRechitClusters_noVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSize_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_noVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_noVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSize_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_muonVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_jetVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnet_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer1_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer1_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer2_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer2_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer3_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer3_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer4_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer4_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer1_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer2_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer3_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer4_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_RPCMatchedBxSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_dtRechitClusterSizeBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nDtRechitClusters_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_MB1Veto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterMaxStation_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_fullVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatched_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_fullHOVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_fullVeto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_RPCMatchedBxSpread_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_fullHOVeto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_RPCMatchedBx_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_fullVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_dtRechitClusterEta_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEta_fullVeto[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_dtRechitClusterPhi_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhi_fullVeto[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_dtRechitClusterR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterR_fullVeto[itr_file] = new TH1D(name,"",40,0,800); + + sprintf(name,"h_dtRechitClusterZ_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZ_fullVeto[itr_file] = new TH1D(name,"",120,-600,600); + + sprintf(name,"h_dtRechitClusterRZ_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterRZ_fullVeto[itr_file] = new TH2D(name,"",120,-600,600,40,400,800); + + sprintf(name,"h_dtRechitClusterRZFine_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterRZFine_fullVeto[itr_file] = new TH2D(name,"",1200,-600,600,400,400,800); + + sprintf(name,"h_dtRechitClusterNWheels50_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels50_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterNWheels25_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels25_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterNWheels1_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels1_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterMaxWheel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxWheel_fullVeto[itr_file] = new TH1D(name,"",6,-3,3); + + sprintf(name,"h_gLLPpt_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLPpt_Bx0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_Bx0_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLPpt_Bx1_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_Bx1_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLP_travel_time_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLP_travel_time_fullVeto[itr_file] = new TH1D(name,"",100,0,10000); + + sprintf(name,"h_npv_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); + h_npv_nDtRechitClusters_fullVeto[itr_file] = new TH2D(name,"",10,0,10,5,0,5); + + sprintf(name,"h_RPCMatchedBx_invertedJetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_RPCMatchedBx_invertedMuonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedMuonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); + + sprintf(name,"h_dtRechitClusterSizeBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterNStation_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_noMB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); + + sprintf(name,"h_dtRechitClusterPercentRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_nRPCMatched_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer1_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer2_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer2_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer12_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer12_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_noMB1Veto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_dtRechitClusterSizeBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_RPCMatch[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_RPCSpread0[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_fullVetoPlus[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterEta_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEta_fullVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_dtRechitClusterPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhi_fullVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_dtRechitClusterEtaPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); + + sprintf(name,"h_dtRechitClusterNStation_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullVetoPlus[itr_file] = new TH1D(name,"",4,0,4); + + sprintf(name,"h_dtRechitClusterNWheel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheel_fullVetoPlus[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullHOVetoPlus[itr_file] = new TH1D(name,"",4,0,4); + + sprintf(name,"h_dtRechitClusterNWheel_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoMinus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_HOMatchedEnergyCluster280Magnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_HOTime_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_HOTime_fullHOVeto[itr_file] = new TH1D(name,"",60,-60,60); + + sprintf(name,"h_muonPt_jetMB1Veto_%s_%s",mX[itr_mX],ctau); + h_muonPt_jetMB1Veto[itr_file] = new TH1D(name,"",50,0,100); + + sprintf(name,"h_jetPt_muonMB1Veto_%s_%s",mX[itr_mX],ctau); + h_jetPt_muonMB1Veto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_MB1Rechits_jetMuonVeto_%s_%s",mX[itr_mX],ctau); + h_MB1Rechits_jetMuonVeto[itr_file] = new TH1D(name,"",200,0,200); + + sprintf(name,"h_muonPt_jetHOVeto_%s_%s",mX[itr_mX],ctau); + h_muonPt_jetHOVeto[itr_file] = new TH1D(name,"",50,0,100); + + sprintf(name,"h_jetPt_muonHOVeto_%s_%s",mX[itr_mX],ctau); + h_jetPt_muonHOVeto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_HOEnergy_jetMuonVeto_%s_%s",mX[itr_mX],ctau); + h_HOEnergy_jetMuonVeto[itr_file] = new TH1D(name,"",40,0,200); + + sprintf(name,"h_muonDR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_muonDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_muonDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_muonDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_jetDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_jetDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_jetDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_muonDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); + h_muonDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); + h_muonDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_jetDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); + h_jetDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); + h_jetDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_decayVertexRadius_noVeto_%s_%s",mX[itr_mX],ctau); + h_decayVertexRadius_noVeto[itr_file] = new TH1D(name,"",80,0,800); + + sprintf(name,"h_HOEnergy_jetVeto_%s_%s",mX[itr_mX],ctau); + h_HOEnergy_jetVeto[itr_file] = new TH1D(name,"",40,0,200); + + sprintf(name,"h_dRClusterRPC_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dRClusterRPC_jetVeto[itr_file] = new TH1D(name,"",30,0,3); + + sprintf(name,"h_dRClusterHO_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dRClusterHO_jetVeto[itr_file] = new TH1D(name,"",30,0,3); + + sprintf(name,"h_jetDR_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetDR_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetPt_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetPt_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_jetEta_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetEta_minDR_vetoJet[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_jetPhi_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetPhi_minDR_vetoJet[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_jetChargedEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetDR_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetDR_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetPt_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetPt_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_jetEta_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetEta_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_jetPhi_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetPhi_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_jetChargedEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + evtNum = 0; + totalNum = 0; + //weight = lumi*xSec*1000/treeReader.GetEntries(1); + totalEvents=0; + totalMagnetEvents=0; + totalBarrelEvents=0; + noEff=0.0; + muonEff=0.0; + jetEff=0.0; + MB1Eff=0.0; + HOEff=0.0; + fullEff=0.0; + fullHOEff=0.0; + + nPassMET=0; + nPassDTDecay=0; + nPassJetMET=0; + nPassNoVeto=0; + nPassFullVeto=0; + + nPassMaxStation=0; + nPassDeltaPhi=0; + nPassRPCMatch=0; + nPassRPCSpread=0; + + nPassHODecay=0; + nPassNoVeto_ho=0; + nPassFullVeto_ho=0; + nPassDeltaPhi_ho=0; + nPassRPCMatch_ho=0; + nPassRPCSpread_ho=0; + + cout << mX[itr_mX] << "_" << ctau << endl; + for(Int_t itr_year = 0; itr_year<3; itr_year++) { + cout << " " << years[itr_year] << endl; + + TFile *_file; + if(strcmp(years[itr_year],"MC_Summer16")==0){ + cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root" << endl; + //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + } + else{ + cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" << endl; + //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + } + cout << "Opened ntuple files" << endl; + + /*if(strcmp(mX[itr_mX],"450")==0){ + _file = TFile::Open(dir+"/signal_1000_"+mX[itr_mX]+"_"+ctau+".root"); + } + else{ + _file = TFile::Open(dir+"/signal_125_"+mX[itr_mX]+"_"+ctau+".root"); + } + + TTreeReader treeReader("ntuples/llp",_file); + */ + TTreeReader treeReader("MuonSystem",_file); + + TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); + //TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); + //TTreeReaderArray gLLP_pt(treeReader,"gLLP_pt"); + TTreeReaderArray gLLP_decay_vertex_x(treeReader,"gLLP_decay_vertex_x"); + TTreeReaderArray gLLP_decay_vertex_y(treeReader,"gLLP_decay_vertex_y"); + TTreeReaderArray gLLP_decay_vertex_z(treeReader,"gLLP_decay_vertex_z"); + //TTreeReaderArray gLLP_travel_time(treeReader,"gLLP_travel_time"); + + //TTreeReaderValue weight(treeReader,"weight"); + //TTreeReaderValue npv(treeReader,"npv"); + TTreeReaderValue MET(treeReader,"met"); + TTreeReaderValue METphi(treeReader,"metPhi"); + //TTreeReaderValue MET(treeReader,"metType1Pt"); + //TTreeReaderValue METphi(treeReader,"metType1Phi"); + //TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); + + TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); + TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); + TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); + TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); + TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); + TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); + TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); + TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); + TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); + TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); + TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); + TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); + TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); + TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); + TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); + TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); + TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); + TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); + TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); + + /*TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); + TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); + TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); + TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); + TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); + TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); + TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); + TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); + */ + TTreeReaderValue nJets(treeReader,"nJets"); + TTreeReaderArray jetPt(treeReader,"jetPt"); + TTreeReaderArray jetEta(treeReader,"jetEta"); + TTreeReaderArray jetPhi(treeReader,"jetPhi"); + TTreeReaderArray jetChargedEMEnergyFraction(treeReader,"jetChargedEMEnergyFraction"); + TTreeReaderArray jetNeutralEMEnergyFraction(treeReader,"jetNeutralEMEnergyFraction"); + TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); + TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); + + TTreeReaderValue nMuons(treeReader,"nMuons"); + TTreeReaderArray muonEta(treeReader,"muonEta"); + TTreeReaderArray muonPhi(treeReader,"muonPhi"); + TTreeReaderArray muonPt(treeReader,"muonPt"); + + TTreeReaderValue nRPCRechits(treeReader,"nRpc"); + TTreeReaderArray RPCRechitX(treeReader,"rpcX"); + TTreeReaderArray RPCRechitY(treeReader,"rpcY"); + TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); + TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); + TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); + + TTreeReaderValue nHORechits(treeReader,"nHORechits"); + TTreeReaderArray HORechitE(treeReader,"hoRechit_E"); + TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); + TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); + TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); + + totalNum += treeReader.GetEntries(1); + cout << "Loop on " << totalNum << " entries." << endl; + _ofile->cd(); + while(treeReader.Next()){ + goodEvt = false; + goodDecay = false; + magnetDecay = false; + clustSizeMax = 0.; + dPhi_min = 999.; + jetPt_tmp = 0.0; + if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } + + for(Int_t itr_llp=0; itr_llp<2; itr_llp++){ + if(gLLP_decay_vertex_z[itr_llp] < 650.){ + h_decayVertexRadius_noVeto[itr_file]->Fill(sqrt(pow(gLLP_decay_vertex_x[itr_llp],2)+pow(gLLP_decay_vertex_y[itr_llp],2))); + } + } + if(gLLP_dt[0] || gLLP_dt[1]){ goodDecay = true; } + else if(sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) > 300. && abs(gLLP_decay_vertex_z[0]) < 650.){ magnetDecay = true; } + else if(sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[1],2)) > 300. && abs(gLLP_decay_vertex_z[1]) < 650.){ magnetDecay = true; } + if(*MET > 200){ + //nPassMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassMET += 1; + } + if(*MET > 200){ + //nPassDTDecay += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassDTDecay += 1; + passNoVeto = false; + passFullVeto = false; + passRPCMatch = false; + passRPCSpread = false; + passMaxStation = false; + passDeltaPhi = false; + passFullVeto_ho = false; + passRPCMatch_ho = false; + passRPCSpread_ho = false; + passDeltaPhi_ho = false; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + totalSumE=0.0; + totalBarrelEvents+=1; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + totalClusteredFullPlus = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + //h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); + if(*nJets>0){ + goodJets=0; + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + } + if(dPhi_min!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassJetMET += 1; + h_MET[itr_file]->Fill(*MET); + h_jetPt[itr_file]->Fill(jetPt_tmp); + + if(*nDtRechitClusters > 0){ passNoVeto = true; } + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + passJet = true; + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(jetPt[itr_jet]>20.){ + dPhi_tmp = RPCRechitPhi[itr_jet] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr_jet]-dtRechitClusterEta[itr_clust],2))<0.5){ + passJet = false; + break; + } + } + } + if(!passJet){ passInvertedJet = true; } + //if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + //else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + if(dtRechitClusterSize[itr_clust]>50){ + + nPassNone+=1; + noEff+=1.0; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ + match+=1; + rpcBx.push_back(RPCRechitBx[itr_rpc]); + rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); + } + } + + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ + dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(sumE>40.){ passHO = true; } + + muonPt_max = 0.0; + muonDR_min = 999.0; + for(Int_t itr=0; itr<*nMuons; itr++){ + dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(muonPt[itr]>muonPt_max){ + muonPt_max=muonPt[itr]; + } + } + if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(jetPt[itr]>jetPt_max){ + jetPt_max=jetPt[itr]; + } + } + if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))Fill(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))); + h_jetPt_minDR_vetoJet[itr_file]->Fill(jetPt[itr]); + h_jetEta_minDR_vetoJet[itr_file]->Fill(jetEta[itr]); + h_jetPhi_minDR_vetoJet[itr_file]->Fill(jetPhi[itr]); + h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedEMEnergyFraction[itr]); + h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralEMEnergyFraction[itr]); + h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedHadronEnergyFraction[itr]); + h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralHadronEnergyFraction[itr]); + } + } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + + h_dtRechitClusterSize_noVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_noVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_noVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_noVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_noVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_noVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_noVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_noVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_noVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_noVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } + } + + if(passMuon){ + nPassMuon+=1; + muonEff+=1.0; + h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_muonVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_muonVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_muonVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_muonVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_muonVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_muonVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_muonVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_muonVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_muonVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } + } + } + + if(passJet){ + nPassJet+=1; + jetEff+=1.0; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_jetVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_jetVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_jetVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_jetVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_jetVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_jetVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_jetVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_jetVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_jetVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } + } + } + + if(passMB1){ + nPassMB1+=1; + MB1Eff+=1.0; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_MB1Veto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_MB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_MB1Veto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_MB1Veto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_MB1Veto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_MB1Veto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_MB1Veto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_MB1Veto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_MB1Veto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } + } + } + + if(passInvertedJet && passMB1){ + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + + if(passInvertedMuon && passMB1){ + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + + if(passInvertedJet && passInvertedMuon && passMB1){ + //cout << "inverted mu jet" << endl; + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + //cout << "done inverted" << endl; + + if(passMuon && passJet){ + //cout << "no MB1" << endl; + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); + h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file]->Fill(float(dtRechitClusterNSegmentStation1[itr_clust]) / dtRechitClusterSize[itr_clust]); + h_dtRechitClusterNStation_noMB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_nRPCMatched_noMB1Veto[itr_file]->Fill(match); + h_MB1Rechits_jetMuonVeto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); + if(!rpcLayer.empty()){ + h_RPCMatchedBxSpread_noMB1Veto[itr_file]->Fill(max_element(rpcBx.begin(),rpcBx.end()) - min_element(rpcBx.begin(),rpcBx.end())); + for(Int_t itr = 0; itrFill(matchLayer1); + h_nRPCMatchedLayer2_noMB1Veto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedLayer12_noMB1Veto[itr_file]->Fill(matchLayer1+matchLayer2); + } + //cout << "done no MB1" << endl; + + if(passMuon && passJet && passMB1){ + passFullVeto = true; + nPassFull+=1; + fullEff+=1.0; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_fullVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_fullVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_fullVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_fullVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_fullVeto[itr_file]->Fill(match); + + h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); + h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); + h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); + h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + + h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); + + //h_gLLP_travel_time_fullVeto[itr_file]->Fill(gLLP_travel_time[llp_itr]); + //h_gLLPpt_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); + if(!rpcBx.empty()){ + rpcMean = accumulate(rpcBx.begin(), rpcBx.end(), 0.0) / rpcBx.size(); + //if(abs(rpcMean)<0.5){ h_gLLPpt_Bx0_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } + //else if(rpcMean < 1.5){ h_gLLPpt_Bx1_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } + } + + h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); + + if(!rpcBx.empty()){ + passRPCMatch = true; + h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_muonDR_RPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_RPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread = true; + h_dtRechitClusterSize_RPCSpread0[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_muonDR_RPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_RPCSpread0[itr_file]->Fill(jetDR_min); + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation = true; + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi = true; + totalClusteredFullPlus+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterXSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); + h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); + h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); + h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + //h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); + } + } + } + } + + } + + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeBarrel_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + /*if(passMuon && passJet && passHO){ + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + }*/ + + if(passMuon && passMB1){ + h_jetPt_muonMB1Veto[itr_file]->Fill(jetPt_max); + } + + if(passJet && passMB1){ + h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); + } + if(passJet && passMuon && passHO){ + passFullVeto_ho = true; + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); + h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); + h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); + + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); + + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); + + if(!rpcBx.empty()){ + passRPCMatch_ho = true; + h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread_ho = true; + h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi_ho = true; + totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); + h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); + h_jetEta_minDR_fullHOVetoPlus[itr_file]->Fill(jetEta[jetDR_index]); + h_jetPhi_minDR_fullHOVetoPlus[itr_file]->Fill(jetPhi[jetDR_index]); + h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); + h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); + h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); + h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); + } + } + } + } + } + } + if(passFullVeto_ho){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch_ho){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread_ho){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi_ho){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + if(passNoVeto){ nPassNoVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passFullVeto){ nPassFullVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch){ nPassRPCMatch += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread){ nPassRPCSpread += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passMaxStation){ nPassMaxStation += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi){ nPassDeltaPhi += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); + h_nDtRechitClusters_muonVeto[itr_file]->Fill(nPassMuon); + h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); + h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); + h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); + + if(nPassNone>0){ h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETBarrel_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETBarrel_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETBarrel_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETBarrel_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); } + //h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); + //h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); + h_nTotalClusteredRechitsBarrel_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsBarrel_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsBarrel_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsBarrel_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + + h_dPhiClusterMETMax[itr_file]->Fill(dPhiClusterMET_max); + + h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); + } + } + + /*if(*MET>200 && magnetDecay){ + nPassHODecay+=1; + totalMagnetEvents+=1; + passNoVeto = false; + passFullVeto = false; + passRPCMatch = false; + passRPCSpread = false; + passMaxStation = false; + passDeltaPhi = false; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + goodJets=0; + totalSumE=0.0; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + totalClusteredFullHOPlus = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + h_dPhiJetMETMagnet[itr_file]->Fill(fabs(dPhi_min)); + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + nPassJetMET+=1; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + passNoVeto = true; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ + match+=1; + rpcBx.push_back(RPCRechitBx[itr_rpc]); + rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); + } + } + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + if(!rpcLayer.empty()){ + for(Int_t itr = 0; itr TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(passJet){ + h_dRClusterHO_jetVeto[itr_file]->Fill(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))); + } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(passJet){ + h_HOEnergy_jetVeto[itr_file]->Fill(sumE); + } + if(sumE>40.){ passHO = true; } + + muonPt_max = 0.0; + muonDR_min = 999.0; + for(Int_t itr=0; itr<*nMuons; itr++){ + dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(muonPt[itr]>muonPt_max){ + muonPt_max=muonPt[itr]; + } + } + if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(jetPt[itr]>jetPt_max){ + jetPt_max=jetPt[itr]; + } + } + if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))50){ + + nPassNone+=1; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + if(passMuon){ + nPassMuon+=1; + } + if(passJet){ + nPassJet+=1; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_nRPCMatchedMagnet_jetVeto[itr_file]->Fill(match); + + h_nRPCMatchedMagnetLayer1_jetVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_jetVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_jetVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_jetVeto[itr_file]->Fill(matchLayer4); + } + if(passMB1){ + nPassMB1+=1; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon){ + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_HOEnergy_jetMuonVeto[itr_file]->Fill(sumE); + if(dtRechitClusterSize[itr_clust]>=280){ + totalSumE+=sumE; + } + } + if(passJet && passHO){ + h_muonPt_jetHOVeto[itr_file]->Fill(muonPt_max); + } + if(passMuon && passHO){ + h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); + } + if(passJet && passMuon && passMB1){ + nPassFull+=1; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passHO){ + passFullVeto = true; + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); + h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); + h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); + + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); + + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); + + if(!rpcBx.empty()){ + passRPCMatch = true; + h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread = true; + h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi = true; + totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; + } + } + } + } + } + } + h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file]->Fill(totalSumE); + + if(passNoVeto){ nPassNoVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passFullVeto){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + if(nPassNone>0){ h_dPhiJetMETMagnet_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETMagnet_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETMagnet_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETMagnet_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETMagnet_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETMagnet_fullVeto[itr_file]->Fill(dPhi_min); } + if(nPassFullHO>0){ h_dPhiJetMETMagnet_fullHOVeto[itr_file]->Fill(dPhi_min); } + + h_nTotalClusteredRechitsMagnet_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsMagnet_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsMagnet_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsMagnet_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); + } + }*/ + /*if(*MET>200){ + totalEvents+=1; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + goodJets=0; + totalSumE=0.0; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ + dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(sumE>40.){ passHO = true; } + + if(dtRechitClusterSize[itr_clust]>50){ + + nPassNone+=1; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + if(passMuon){ + nPassMuon+=1; + } + if(passJet){ + nPassJet+=1; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passMB1){ + nPassMB1+=1; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon){ + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passMB1){ + nPassFull+=1; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passHO){ + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + } + } + if(nPassNone>0){ h_dPhiJetMETAll_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETAll_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETAll_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETAll_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETAll_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETAll_fullVeto[itr_file]->Fill(dPhi_min); } + + h_nTotalClusteredRechitsAll_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsAll_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsAll_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsAll_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsAll_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsAll_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsAll_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + } + }*/ + evtNum+=1; + } + + } + //cout << "Total events = " << totalEvents << endl; + //cout << "Total magnet events = " << totalMagnetEvents << endl; + //cout << "Total barrel events = " << totalBarrelEvents << endl; + + cout << "MET > 200: " << nPassMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + //cout << "DT Decay: " << nPassDTDecay * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "No Veto: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Full Veto: " << nPassFullVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "nRPC Matched > 0: " << nPassRPCMatch * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "RPC Spread = 0: " << nPassRPCSpread * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Max Station > 2: " << nPassMaxStation * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << " " << endl; + //cout << "HO Decay: " << nPassHODecay * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "No Veto: " << nPassNoVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Full Veto: " << nPassFullVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "nRPC Matched > 0: " << nPassRPCMatch_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "RPC Spread = 0: " << nPassRPCSpread_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << " " << endl; + + itr_file+=1; + } + + _ofile->Write(); + _ofile->Close(); + +} From 44103cd5a868d2cb61616ff7131facdd1e05f3a8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Oct 2020 13:57:44 -0500 Subject: [PATCH 03/15] file for LPC --- analyzeSignal_SD.C | 2309 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2309 insertions(+) create mode 100644 analyzeSignal_SD.C diff --git a/analyzeSignal_SD.C b/analyzeSignal_SD.C new file mode 100644 index 0000000..8bb29cc --- /dev/null +++ b/analyzeSignal_SD.C @@ -0,0 +1,2309 @@ +R__LOAD_LIBRARY(libTreePlayer) + +int getStation(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 400. && hitR < 480.){ return 1; } + else if(hitR > 485. && hitR < 560.){ return 2; } + else if(hitR > 590. && hitR < 650.){ return 3; } + else if(hitR > 690. && hitR < 800.){ return 4; } + else{ return -1; } +} + +int getWheel(float hitZ){ + if(hitZ > 0){ + if(hitZ < 127.){ return 0; } + else if(hitZ < 395.){ return 1; } + else if(hitZ < 661.){ return 2; } + else{ return -99; } + } + else{ + return -1*getWheel(-1.0*hitZ); + } +} + +int getRPCLayer(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 410. && hitR < 440.){ return 1; } + else if(hitR > 445. && hitR < 475.){ return 2; } + else if(hitR > 490. && hitR < 520.){ return 3; } + else if(hitR > 525. && hitR < 555.){ return 4; } + else if(hitR > 600. && hitR < 630.){ return 5; } + else if(hitR > 700. && hitR < 770.){ return 6; } + else{ return -1; } +} + +void analyzeSignal(){ + + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; + } + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; + } + + char name[50]; + char title[100]; + char mX[3][10] = {"15","40","55"}; + //char mX[2][10] = {"25","450"}; + //char ctau[10] = "1m"; + char ctau[10] = "10000"; + char years[3][10] = {"2018","2017","2016"}; + char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; + char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); + for(Int_t itr_year=0; itr_year < 3; itr_year++){ + TFile *_file; + _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_" + + runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); + + //TString dir("/storage/user/mcitron/signalPointsGGHWithRPCWithFlags/"); + //TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + // TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + + + /* + data files + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + + 2016 data for ex: /mnt/hadoop/store/group/phys_exotica/delayedjets/disp +lacedJetMuonAnalyzer/driftTube/V1p17/Data2016/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root + + + */ + TFile *_ofile = TFile::Open("outSig_central_V1p17.root","RECREATE"); + Float_t lumi[3] = {37.8,44.98,63.67}; + Float_t xSec = 48.58; + Float_t weight; + + TH1D *h_dPhiClusterMET[4]; + TH1D *h_dPhiClusterMETMax[4]; + TH1D *h_dPhiJetMET[4]; + TH1D *h_jetMet_dPhiMin4[4]; + TH1D *h_MET[4]; + TH1D *h_jetPt[4]; + + TH1D *h_dPhiJetMETBarrel_noVeto[4]; + TH1D *h_dPhiJetMETBarrel_jetVeto[4]; + TH1D *h_dPhiJetMETBarrel_muonVeto[4]; + TH1D *h_dPhiJetMETBarrel_MB1Veto[4]; + TH1D *h_dPhiJetMETBarrel_noMB1Veto[4]; + TH1D *h_dPhiJetMETBarrel_fullVeto[4]; + TH1D *h_dPhiJetMETMagnet_noVeto[4]; + TH1D *h_dPhiJetMETMagnet_jetVeto[4]; + TH1D *h_dPhiJetMETMagnet_muonVeto[4]; + TH1D *h_dPhiJetMETMagnet_MB1Veto[4]; + TH1D *h_dPhiJetMETMagnet_noMB1Veto[4]; + TH1D *h_dPhiJetMETMagnet_fullVeto[4]; + TH1D *h_dPhiJetMETMagnet_fullHOVeto[4]; + TH1D *h_dPhiJetMETMagnet[4]; + TH1D *h_dPhiJetMETAll_noVeto[4]; + TH1D *h_dPhiJetMETAll_jetVeto[4]; + TH1D *h_dPhiJetMETAll_muonVeto[4]; + TH1D *h_dPhiJetMETAll_MB1Veto[4]; + TH1D *h_dPhiJetMETAll_noMB1Veto[4]; + TH1D *h_dPhiJetMETAll_fullVeto[4]; + + TH1D *h_nDtRechitClusters_noVeto[4]; + TH1D *h_dtRechitClusterSize_noVeto[4]; + TH1D *h_nTotalClusteredRechits_noVeto[4]; + TH1D *h_dtRechitClusterMaxStation_noVeto[4]; + TH1D *h_dtRechitClusterNStation_noVeto[4]; + TH1D *h_dPhiClusterMET_noVeto[4]; + TH1D *h_dtRechitClusterXSpread_noVeto[4]; + TH1D *h_dtRechitClusterYSpread_noVeto[4]; + TH1D *h_dtRechitClusterZSpread_noVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_noVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_noVeto[4]; + TH1D *h_nRPCMatched_noVeto[4]; + TH1D *h_RPCMatchedBx_noVeto[4]; + TH1D *h_RPCMatchedBxSpread_noVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_noVeto[4]; + TH1D *h_nRPCMatched_Spread0_noVeto[4]; + TH2D *h_npv_nDtRechitClusters_noVeto[4]; + + TH1D *h_nDtRechitClusters_muonVeto[4]; + TH1D *h_dtRechitClusterSize_muonVeto[4]; + TH1D *h_nTotalClusteredRechits_muonVeto[4]; + TH1D *h_dtRechitClusterMaxStation_muonVeto[4]; + TH1D *h_dtRechitClusterNStation_muonVeto[4]; + TH1D *h_dPhiClusterMET_muonVeto[4]; + TH1D *h_dtRechitClusterXSpread_muonVeto[4]; + TH1D *h_dtRechitClusterYSpread_muonVeto[4]; + TH1D *h_dtRechitClusterZSpread_muonVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_muonVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_muonVeto[4]; + TH1D *h_nRPCMatched_muonVeto[4]; + TH1D *h_RPCMatchedBx_muonVeto[4]; + TH1D *h_RPCMatchedBxSpread_muonVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; + TH1D *h_nRPCMatched_Spread0_muonVeto[4]; + + TH1D *h_nDtRechitClusters_jetVeto[4]; + TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; + TH1D *h_dtRechitClusterSizeAll_jetVeto[4]; + TH1D *h_dtRechitClusterSize_jetVeto[4]; + TH1D *h_nTotalClusteredRechits_jetVeto[4]; + TH1D *h_dtRechitClusterMaxStation_jetVeto[4]; + TH1D *h_dtRechitClusterNStation_jetVeto[4]; + TH1D *h_dPhiClusterMET_jetVeto[4]; + TH1D *h_dtRechitClusterXSpread_jetVeto[4]; + TH1D *h_dtRechitClusterYSpread_jetVeto[4]; + TH1D *h_dtRechitClusterZSpread_jetVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_jetVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_jetVeto[4]; + TH1D *h_nRPCMatched_jetVeto[4]; + TH1D *h_nRPCMatchedMagnet_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer1_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer2_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer3_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer4_jetVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer1_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer2_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer3_fullHOVeto[4]; + TH1D *h_nRPCMatchedMagnetLayer4_fullHOVeto[4]; + TH1D *h_RPCMatchedBx_jetVeto[4]; + TH1D *h_RPCMatchedBxSpread_jetVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_jetVeto[4]; + TH1D *h_nRPCMatched_Spread0_jetVeto[4]; + + TH1D *h_nDtRechitClusters_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeBarrel_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeMagnet_MB1Veto[4]; + TH1D *h_dtRechitClusterSizeAll_MB1Veto[4]; + TH1D *h_dtRechitClusterSize_MB1Veto[4]; + TH1D *h_nTotalClusteredRechits_MB1Veto[4]; + TH1D *h_dtRechitClusterMaxStation_MB1Veto[4]; + TH1D *h_dtRechitClusterNStation_MB1Veto[4]; + TH1D *h_dPhiClusterMET_MB1Veto[4]; + TH1D *h_dtRechitClusterXSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterYSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterZSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterEtaSpread_MB1Veto[4]; + TH1D *h_dtRechitClusterPhiSpread_MB1Veto[4]; + TH1D *h_nRPCMatched_MB1Veto[4]; + TH1D *h_RPCMatchedBx_MB1Veto[4]; + TH1D *h_RPCMatchedBxSpread_MB1Veto[4]; + TH1D *h_nRPCMatched_Spread0_MB1Veto[4]; + TH1D *h_RPCMatchedBx_Spread0_MB1Veto[4]; + + TH1D *h_nDtRechitClusters_fullVeto[4]; + TH1D *h_dtRechitClusterSizeBarrel_fullVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_fullVeto[4]; + TH1D *h_dtRechitClusterSizeAll_fullVeto[4]; + TH1D *h_dtRechitClusterSize_fullVeto[4]; + TH1D *h_nTotalClusteredRechits_fullVeto[4]; + TH1D *h_dtRechitClusterMaxStation_fullVeto[4]; + TH1D *h_dtRechitClusterMaxStation_fullHOVeto[4]; + TH1D *h_dtRechitClusterNStation_fullVeto[4]; + TH1D *h_dPhiClusterMET_fullVeto[4]; + TH1D *h_dPhiClusterMET_fullHOVeto[4]; + TH1D *h_dtRechitClusterXSpread_fullVeto[4]; + TH1D *h_dtRechitClusterYSpread_fullVeto[4]; + TH1D *h_dtRechitClusterZSpread_fullVeto[4]; + TH1D *h_dtRechitClusterEtaSpread_fullVeto[4]; + TH1D *h_dtRechitClusterPhiSpread_fullVeto[4]; + TH1D *h_nRPCMatched_fullVeto[4]; + TH1D *h_nRPCMatched_fullHOVeto[4]; + TH1D *h_RPCMatchedBx_fullVeto[4]; + TH1D *h_RPCMatchedBxSpread_fullVeto[4]; + TH1D *h_RPCMatchedBxSpread_fullHOVeto[4]; + TH1D *h_nRPCMatched_Spread0_fullVeto[4]; + TH1D *h_RPCMatchedBx_Spread0_fullVeto[4]; + + TH1D *h_dtRechitClusterEta_fullVeto[4]; + TH1D *h_dtRechitClusterPhi_fullVeto[4]; + TH1D *h_dtRechitClusterR_fullVeto[4]; + TH1D *h_dtRechitClusterZ_fullVeto[4]; + TH2D *h_dtRechitClusterRZ_fullVeto[4]; + TH2D *h_dtRechitClusterRZFine_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels50_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels25_fullVeto[4]; + TH1D *h_dtRechitClusterNWheels1_fullVeto[4]; + TH1D *h_dtRechitClusterMaxWheel_fullVeto[4]; + TH2D *h_npv_nDtRechitClusters_fullVeto[4]; + TH1D *h_gLLPpt_fullVeto[4]; + TH1D *h_gLLPpt_Bx0_fullVeto[4]; + TH1D *h_gLLPpt_Bx1_fullVeto[4]; + TH1D *h_gLLP_travel_time_fullVeto[4]; + + TH1D *h_RPCMatchedBx_invertedJetVeto[4]; + TH1D *h_RPCMatchedBx_invertedMuonVeto[4]; + TH1D *h_RPCMatchedBx_invertedMuJetVeto[4]; + + TH1D *h_dtRechitClusterSize_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeBarrel_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeMagnet_noMB1Veto[4]; + TH1D *h_dtRechitClusterSizeAll_noMB1Veto[4]; + TH1D *h_dtRechitClusterNStation_noMB1Veto[4]; + TH1D *h_dtRechitClusterNRechitsMB1_noMB1Veto[4]; + TH1D *h_dtRechitClusterPercentRechitsMB1_noMB1Veto[4]; + TH1D *h_nRPCMatched_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer1_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer2_noMB1Veto[4]; + TH1D *h_nRPCMatchedLayer12_noMB1Veto[4]; + TH1D *h_RPCMatchedBxSpread_noMB1Veto[4]; + + TH1D *h_dtRechitClusterSizeBarrel_HOVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_HOVeto[4]; + TH1D *h_dtRechitClusterSizeAll_HOVeto[4]; + + TH1D *h_dtRechitClusterSizeBarrel_fullHOVeto[4]; + TH1D *h_dtRechitClusterSizeMagnet_fullHOVeto[4]; + TH1D *h_dtRechitClusterSizeAll_fullHOVeto[4]; + + TH1D *h_nTotalClusteredRechitsBarrel_noVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_noVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_noVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_jetVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsAll_MB1Veto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsAll_noMB1Veto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_HOVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_fullVeto[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullHOVeto[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullHOVeto[4]; + TH1D *h_nTotalClusteredRechitsAll_fullHOVeto[4]; + + TH1D *h_dtRechitClusterSize_RPCMatch[4]; + TH1D *h_dtRechitClusterSize_RPCSpread0[4]; + TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; + TH1D *h_nTotalClusteredRechitsBarrel_fullVetoPlus[4]; + TH1D *h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[4]; + TH1D *h_dtRechitClusterXSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterYSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterZSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterEtaSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterPhiSpread_fullVetoPlus[4]; + TH1D *h_dtRechitClusterEta_fullVetoPlus[4]; + TH1D *h_dtRechitClusterPhi_fullVetoPlus[4]; + TH2D *h_dtRechitClusterEtaPhi_fullVetoPlus[4]; + TH1D *h_dtRechitClusterNStation_fullVetoPlus[4]; + TH1D *h_dtRechitClusterSizeRatio_fullVetoPlus[4]; + TH1D *h_dtRechitClusterSizeRatio_fullVetoMinus[4]; + TH1D *h_dtRechitClusterNWheel_fullVetoPlus[4]; + TH1D *h_dtRechitClusterNStation_fullHOVetoPlus[4]; + TH1D *h_dtRechitClusterNWheel_fullHOVetoPlus[4]; + + TH1D *h_HOMatchedEnergyCluster280Magnet_noMB1Veto[4]; + + TH1D *h_HOTime_fullHOVeto[4]; + + TH1D *h_muonPt_jetMB1Veto[4]; + TH1D *h_jetPt_muonMB1Veto[4]; + TH1D *h_MB1Rechits_jetMuonVeto[4]; + TH1D *h_muonPt_jetHOVeto[4]; + TH1D *h_jetPt_muonHOVeto[4]; + TH1D *h_HOEnergy_jetMuonVeto[4]; + + TH1D *h_muonDR_fullVeto[4]; + TH1D *h_muonDR_RPCMatch[4]; + TH1D *h_muonDR_RPCSpread0[4]; + TH1D *h_jetDR_fullVeto[4]; + TH1D *h_jetDR_RPCMatch[4]; + TH1D *h_jetDR_RPCSpread0[4]; + TH1D *h_muonDR_fullHOVeto[4]; + TH1D *h_muonDR_HORPCMatch[4]; + TH1D *h_muonDR_HORPCSpread0[4]; + TH1D *h_jetDR_fullHOVeto[4]; + TH1D *h_jetDR_HORPCMatch[4]; + TH1D *h_jetDR_HORPCSpread0[4]; + + TH1D *h_decayVertexRadius_noVeto[4]; + TH1D *h_HOEnergy_jetVeto[4]; + TH1D *h_dRClusterRPC_jetVeto[4]; + TH1D *h_dRClusterHO_jetVeto[4]; + + TH1D *h_jetDR_minDR_fullHOVetoPlus[4]; + TH1D *h_jetPt_minDR_fullHOVetoPlus[4]; + TH1D *h_jetEta_minDR_fullHOVetoPlus[4]; + TH1D *h_jetPhi_minDR_fullHOVetoPlus[4]; + TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[4]; + TH1D *h_jetDR_minDR_vetoJet[4]; + TH1D *h_jetPt_minDR_vetoJet[4]; + TH1D *h_jetEta_minDR_vetoJet[4]; + TH1D *h_jetPhi_minDR_vetoJet[4]; + TH1D *h_jetChargedEMEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetNeutralEMEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetNeutralHadronEnergyFraction_minDR_vetoJet[4]; + TH1D *h_jetChargedHadronEnergyFraction_minDR_vetoJet[4]; + + Double_t dPhi_tmp = 0.0; + Double_t dPhiClusterMET = 0.0; + Double_t dPhiClusterMET_max = 0.0; + Double_t dPhi_min = 999.; + Double_t clustSizeMax = 0.; + Double_t dPhi_clust = 999.; + Double_t jetPt_tmp = 0.0; + Double_t muonPt_max = 0.0; + Double_t muonDR_min = 0.0; + Double_t jetPt_max = 0.0; + Double_t jetDR_min = 0.0; + Int_t jetDR_index = -1; + + vector muStatus = {}; + Double_t dR_tmp = 0.0; + Int_t nMatched = 0; + vector goodStatus = {1,44,51,52,91}; + vector rpcBx = {}; + vector rpcLayer = {}; + vector zWheel = {}; + Int_t rpcSpread = 0; + Float_t rpcMean = 0; + + Int_t evtNum = 0; + Int_t totalNum = 0; + Bool_t goodEvt = false; + Int_t itr_file = 0; + Int_t goodJets = 0; + Bool_t matchJet = false; + Bool_t matchMuon = false; + Int_t match = 0; + Int_t matchLayer1 = 0; + Int_t matchLayer2 = 0; + Int_t matchLayer3 = 0; + Int_t matchLayer4 = 0; + Int_t matchHO = 0; + Float_t sumE = 0.0; + Float_t totalSumE = 0.0; + Float_t weightT = 0.0; + Int_t llp_itr = -1; + + Bool_t passMuon = false; + Bool_t passJet = false; + Bool_t passMB1 = false; + Bool_t passHO = false; + Bool_t passInvertedJet = false; + Bool_t passInvertedMuon = false; + Bool_t passInvertedMuJet = false; + Int_t nPassMuon = 0; + Int_t nPassJet = 0; + Int_t nPassJetMuon = 0; + Int_t nPassMB1 = 0; + Int_t nPassHO = 0; + Int_t nPassFull = 0; + Int_t nPassFullHO = 0; + Int_t nPassNone = 0; + Int_t totalBarrelEvents = 0; + Int_t totalMagnetEvents = 0; + Int_t totalEvents = 0; + Int_t totalClusteredNone = 0; + Int_t totalClusteredNoMB1 = 0; + Int_t totalClusteredJet = 0; + Int_t totalClusteredMB1 = 0; + Int_t totalClusteredHO = 0; + Int_t totalClusteredFull = 0; + Int_t totalClusteredFullHO = 0; + Float_t noEff = 0.0; + Float_t muonEff = 0.0; + Float_t jetEff = 0.0; + Float_t MB1Eff = 0.0; + Float_t HOEff = 0.0; + Float_t fullHOEff = 0.0; + Float_t fullEff = 0.0; + + Bool_t goodDecay = false; + Bool_t magnetDecay = false; + + Bool_t passNoVeto = false; + Bool_t passFullVeto = false; + Bool_t passRPCMatch = false; + Bool_t passRPCSpread = false; + Bool_t passMaxStation = false; + Bool_t passDeltaPhi = false; + Bool_t passFullVeto_ho = false; + Bool_t passRPCMatch_ho = false; + Bool_t passRPCSpread_ho = false; + Bool_t passMaxStation_ho = false; + Bool_t passDeltaPhi_ho = false; + + Float_t nPassMET = 0; + Float_t nPassDTDecay = 0; + Float_t nPassJetMET = 0; + Float_t nPassNoVeto = 0; + Float_t nPassFullVeto = 0; + + Float_t nPassMaxStation = 0; + Float_t nPassDeltaPhi = 0; + Float_t nPassRPCMatch = 0; + Float_t nPassRPCSpread = 0; + + Float_t nPassHODecay = 0; + Float_t nPassNoVeto_ho = 0; + Float_t nPassFullVeto_ho = 0; + Float_t nPassRPCMatch_ho = 0; + Float_t nPassRPCSpread_ho = 0; + Float_t nPassDeltaPhi_ho = 0; + + Int_t totalClusteredFullPlus = 0; + Int_t totalClusteredFullHOPlus = 0; + + cout << "Preparing histograms" << endl; + for(Int_t itr_mX=0; itr_mX<3; itr_mX++){ + sprintf(name,"h_jetMet_dPhiMin4_%s_%s",mX[itr_mX],ctau); + h_jetMet_dPhiMin4[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMET_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMET[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETBarrel_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETMagnet_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETMagnet[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiJetMETAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiJetMETAll_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMET_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMETMax_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMETMax[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_MET_%s_%s",mX[itr_mX],ctau); + h_MET[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_jetPt_%s_%s",mX[itr_mX],ctau); + h_jetPt[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nDtRechitClusters_noVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSize_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_noVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_noVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_noVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_noVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSize_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_muonVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_muonVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_jetVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnet_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer1_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer1_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer2_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer2_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer3_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer3_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer4_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer4_jetVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer1_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer2_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer3_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_nRPCMatchedMagnetLayer4_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); + + sprintf(name,"h_RPCMatchedBxSpread_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_jetVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_dtRechitClusterSizeBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nDtRechitClusters_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_MB1Veto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBx_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nDtRechitClusters_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechits_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechits_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterMaxStation_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterMaxStation_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dPhiClusterMET_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); + + sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_fullVeto[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_RPCMatchedBx_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatched_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_fullHOVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_fullVeto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_RPCMatchedBxSpread_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_fullHOVeto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_RPCMatchedBx_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_Spread0_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_nRPCMatched_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_Spread0_fullVeto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_dtRechitClusterEta_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEta_fullVeto[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_dtRechitClusterPhi_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhi_fullVeto[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_dtRechitClusterR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterR_fullVeto[itr_file] = new TH1D(name,"",40,0,800); + + sprintf(name,"h_dtRechitClusterZ_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZ_fullVeto[itr_file] = new TH1D(name,"",120,-600,600); + + sprintf(name,"h_dtRechitClusterRZ_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterRZ_fullVeto[itr_file] = new TH2D(name,"",120,-600,600,40,400,800); + + sprintf(name,"h_dtRechitClusterRZFine_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterRZFine_fullVeto[itr_file] = new TH2D(name,"",1200,-600,600,400,400,800); + + sprintf(name,"h_dtRechitClusterNWheels50_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels50_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterNWheels25_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels25_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterNWheels1_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheels1_fullVeto[itr_file] = new TH1D(name,"",6,0,6); + + sprintf(name,"h_dtRechitClusterMaxWheel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterMaxWheel_fullVeto[itr_file] = new TH1D(name,"",6,-3,3); + + sprintf(name,"h_gLLPpt_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLPpt_Bx0_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_Bx0_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLPpt_Bx1_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLPpt_Bx1_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_gLLP_travel_time_fullVeto_%s_%s",mX[itr_mX],ctau); + h_gLLP_travel_time_fullVeto[itr_file] = new TH1D(name,"",100,0,10000); + + sprintf(name,"h_npv_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); + h_npv_nDtRechitClusters_fullVeto[itr_file] = new TH2D(name,"",10,0,10,5,0,5); + + sprintf(name,"h_RPCMatchedBx_invertedJetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_RPCMatchedBx_invertedMuonVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedMuonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); + + sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); + + sprintf(name,"h_dtRechitClusterSizeBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterNStation_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_noMB1Veto[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); + + sprintf(name,"h_dtRechitClusterPercentRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_nRPCMatched_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer1_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer1_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer2_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer2_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_nRPCMatchedLayer12_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nRPCMatchedLayer12_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); + + sprintf(name,"h_RPCMatchedBxSpread_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_RPCMatchedBxSpread_noMB1Veto[itr_file] = new TH1D(name,"",10,0,10); + + sprintf(name,"h_dtRechitClusterSizeBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_HOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSizeAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_noVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_noVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_jetVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_MB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_HOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_fullVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_RPCMatch[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterSize_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSize_RPCSpread0[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); + + sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterYSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterYSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); + + sprintf(name,"h_dtRechitClusterZSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterZSpread_fullVetoPlus[itr_file] = new TH1D(name,"",30,0,150); + + sprintf(name,"h_dtRechitClusterEtaSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterPhiSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); + + sprintf(name,"h_dtRechitClusterEta_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEta_fullVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_dtRechitClusterPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterPhi_fullVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_dtRechitClusterEtaPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); + + sprintf(name,"h_dtRechitClusterNStation_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullVetoPlus[itr_file] = new TH1D(name,"",4,0,4); + + sprintf(name,"h_dtRechitClusterNWheel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheel_fullVetoPlus[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterNStation_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNStation_fullHOVetoPlus[itr_file] = new TH1D(name,"",4,0,4); + + sprintf(name,"h_dtRechitClusterNWheel_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file] = new TH1D(name,"",5,0,5); + + sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoPlus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoMinus_%s_%s",mX[itr_mX],ctau); + h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_HOMatchedEnergyCluster280Magnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); + h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_HOTime_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_HOTime_fullHOVeto[itr_file] = new TH1D(name,"",60,-60,60); + + sprintf(name,"h_muonPt_jetMB1Veto_%s_%s",mX[itr_mX],ctau); + h_muonPt_jetMB1Veto[itr_file] = new TH1D(name,"",50,0,100); + + sprintf(name,"h_jetPt_muonMB1Veto_%s_%s",mX[itr_mX],ctau); + h_jetPt_muonMB1Veto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_MB1Rechits_jetMuonVeto_%s_%s",mX[itr_mX],ctau); + h_MB1Rechits_jetMuonVeto[itr_file] = new TH1D(name,"",200,0,200); + + sprintf(name,"h_muonPt_jetHOVeto_%s_%s",mX[itr_mX],ctau); + h_muonPt_jetHOVeto[itr_file] = new TH1D(name,"",50,0,100); + + sprintf(name,"h_jetPt_muonHOVeto_%s_%s",mX[itr_mX],ctau); + h_jetPt_muonHOVeto[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_HOEnergy_jetMuonVeto_%s_%s",mX[itr_mX],ctau); + h_HOEnergy_jetMuonVeto[itr_file] = new TH1D(name,"",40,0,200); + + sprintf(name,"h_muonDR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_muonDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_muonDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_muonDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_fullVeto_%s_%s",mX[itr_mX],ctau); + h_jetDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_RPCMatch_%s_%s",mX[itr_mX],ctau); + h_jetDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); + h_jetDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_muonDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); + h_muonDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_muonDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); + h_muonDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); + h_jetDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); + h_jetDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); + h_jetDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_decayVertexRadius_noVeto_%s_%s",mX[itr_mX],ctau); + h_decayVertexRadius_noVeto[itr_file] = new TH1D(name,"",80,0,800); + + sprintf(name,"h_HOEnergy_jetVeto_%s_%s",mX[itr_mX],ctau); + h_HOEnergy_jetVeto[itr_file] = new TH1D(name,"",40,0,200); + + sprintf(name,"h_dRClusterRPC_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dRClusterRPC_jetVeto[itr_file] = new TH1D(name,"",30,0,3); + + sprintf(name,"h_dRClusterHO_jetVeto_%s_%s",mX[itr_mX],ctau); + h_dRClusterHO_jetVeto[itr_file] = new TH1D(name,"",30,0,3); + + sprintf(name,"h_jetDR_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetDR_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetPt_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetPt_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_jetEta_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetEta_minDR_vetoJet[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_jetPhi_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetPhi_minDR_vetoJet[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_jetChargedEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); + h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetDR_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetDR_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,2); + + sprintf(name,"h_jetPt_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetPt_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,200); + + sprintf(name,"h_jetEta_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetEta_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); + + sprintf(name,"h_jetPhi_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetPhi_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); + + sprintf(name,"h_jetChargedEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); + h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); + + evtNum = 0; + totalNum = 0; + //weight = lumi*xSec*1000/treeReader.GetEntries(1); + totalEvents=0; + totalMagnetEvents=0; + totalBarrelEvents=0; + noEff=0.0; + muonEff=0.0; + jetEff=0.0; + MB1Eff=0.0; + HOEff=0.0; + fullEff=0.0; + fullHOEff=0.0; + + nPassMET=0; + nPassDTDecay=0; + nPassJetMET=0; + nPassNoVeto=0; + nPassFullVeto=0; + + nPassMaxStation=0; + nPassDeltaPhi=0; + nPassRPCMatch=0; + nPassRPCSpread=0; + + nPassHODecay=0; + nPassNoVeto_ho=0; + nPassFullVeto_ho=0; + nPassDeltaPhi_ho=0; + nPassRPCMatch_ho=0; + nPassRPCSpread_ho=0; + + cout << mX[itr_mX] << "_" << ctau << endl; + for(Int_t itr_year = 0; itr_year<3; itr_year++) { + cout << " " << years[itr_year] << endl; + + TFile *_file; + if(strcmp(years[itr_year],"MC_Summer16")==0){ + cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root" << endl; + //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + } + else{ + cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" << endl; + //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + } + cout << "Opened ntuple files" << endl; + + /*if(strcmp(mX[itr_mX],"450")==0){ + _file = TFile::Open(dir+"/signal_1000_"+mX[itr_mX]+"_"+ctau+".root"); + } + else{ + _file = TFile::Open(dir+"/signal_125_"+mX[itr_mX]+"_"+ctau+".root"); + } + + TTreeReader treeReader("ntuples/llp",_file); + */ + TTreeReader treeReader("MuonSystem",_file); + + TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); + //TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); + //TTreeReaderArray gLLP_pt(treeReader,"gLLP_pt"); + TTreeReaderArray gLLP_decay_vertex_x(treeReader,"gLLP_decay_vertex_x"); + TTreeReaderArray gLLP_decay_vertex_y(treeReader,"gLLP_decay_vertex_y"); + TTreeReaderArray gLLP_decay_vertex_z(treeReader,"gLLP_decay_vertex_z"); + //TTreeReaderArray gLLP_travel_time(treeReader,"gLLP_travel_time"); + + //TTreeReaderValue weight(treeReader,"weight"); + //TTreeReaderValue npv(treeReader,"npv"); + TTreeReaderValue MET(treeReader,"met"); + TTreeReaderValue METphi(treeReader,"metPhi"); + //TTreeReaderValue MET(treeReader,"metType1Pt"); + //TTreeReaderValue METphi(treeReader,"metType1Phi"); + //TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); + + TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); + TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); + TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); + TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); + TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); + TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); + TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); + TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); + TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); + TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); + TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); + TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); + TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); + TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); + TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); + TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); + TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); + TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); + TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); + + /*TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); + TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); + TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); + TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); + TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); + TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); + TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); + TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); + */ + TTreeReaderValue nJets(treeReader,"nJets"); + TTreeReaderArray jetPt(treeReader,"jetPt"); + TTreeReaderArray jetEta(treeReader,"jetEta"); + TTreeReaderArray jetPhi(treeReader,"jetPhi"); + TTreeReaderArray jetChargedEMEnergyFraction(treeReader,"jetChargedEMEnergyFraction"); + TTreeReaderArray jetNeutralEMEnergyFraction(treeReader,"jetNeutralEMEnergyFraction"); + TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); + TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); + + TTreeReaderValue nMuons(treeReader,"nMuons"); + TTreeReaderArray muonEta(treeReader,"muonEta"); + TTreeReaderArray muonPhi(treeReader,"muonPhi"); + TTreeReaderArray muonPt(treeReader,"muonPt"); + + TTreeReaderValue nRPCRechits(treeReader,"nRpc"); + TTreeReaderArray RPCRechitX(treeReader,"rpcX"); + TTreeReaderArray RPCRechitY(treeReader,"rpcY"); + TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); + TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); + TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); + + TTreeReaderValue nHORechits(treeReader,"nHORechits"); + TTreeReaderArray HORechitE(treeReader,"hoRechit_E"); + TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); + TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); + TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); + + totalNum += treeReader.GetEntries(1); + cout << "Loop on " << totalNum << " entries." << endl; + _ofile->cd(); + while(treeReader.Next()){ + goodEvt = false; + goodDecay = false; + magnetDecay = false; + clustSizeMax = 0.; + dPhi_min = 999.; + jetPt_tmp = 0.0; + if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } + + for(Int_t itr_llp=0; itr_llp<2; itr_llp++){ + if(gLLP_decay_vertex_z[itr_llp] < 650.){ + h_decayVertexRadius_noVeto[itr_file]->Fill(sqrt(pow(gLLP_decay_vertex_x[itr_llp],2)+pow(gLLP_decay_vertex_y[itr_llp],2))); + } + } + if(gLLP_dt[0] || gLLP_dt[1]){ goodDecay = true; } + else if(sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) > 300. && abs(gLLP_decay_vertex_z[0]) < 650.){ magnetDecay = true; } + else if(sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[1],2)) > 300. && abs(gLLP_decay_vertex_z[1]) < 650.){ magnetDecay = true; } + if(*MET > 200){ + //nPassMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassMET += 1; + } + if(*MET > 200){ + //nPassDTDecay += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassDTDecay += 1; + passNoVeto = false; + passFullVeto = false; + passRPCMatch = false; + passRPCSpread = false; + passMaxStation = false; + passDeltaPhi = false; + passFullVeto_ho = false; + passRPCMatch_ho = false; + passRPCSpread_ho = false; + passDeltaPhi_ho = false; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + totalSumE=0.0; + totalBarrelEvents+=1; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + totalClusteredFullPlus = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + //h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); + if(*nJets>0){ + goodJets=0; + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + } + if(dPhi_min!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + nPassJetMET += 1; + h_MET[itr_file]->Fill(*MET); + h_jetPt[itr_file]->Fill(jetPt_tmp); + + if(*nDtRechitClusters > 0){ passNoVeto = true; } + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + passJet = true; + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(jetPt[itr_jet]>20.){ + dPhi_tmp = RPCRechitPhi[itr_jet] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr_jet]-dtRechitClusterEta[itr_clust],2))<0.5){ + passJet = false; + break; + } + } + } + if(!passJet){ passInvertedJet = true; } + //if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + //else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + if(dtRechitClusterSize[itr_clust]>50){ + + nPassNone+=1; + noEff+=1.0; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ + match+=1; + rpcBx.push_back(RPCRechitBx[itr_rpc]); + rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); + } + } + + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ + dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(sumE>40.){ passHO = true; } + + muonPt_max = 0.0; + muonDR_min = 999.0; + for(Int_t itr=0; itr<*nMuons; itr++){ + dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(muonPt[itr]>muonPt_max){ + muonPt_max=muonPt[itr]; + } + } + if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(jetPt[itr]>jetPt_max){ + jetPt_max=jetPt[itr]; + } + } + if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))Fill(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))); + h_jetPt_minDR_vetoJet[itr_file]->Fill(jetPt[itr]); + h_jetEta_minDR_vetoJet[itr_file]->Fill(jetEta[itr]); + h_jetPhi_minDR_vetoJet[itr_file]->Fill(jetPhi[itr]); + h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedEMEnergyFraction[itr]); + h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralEMEnergyFraction[itr]); + h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedHadronEnergyFraction[itr]); + h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralHadronEnergyFraction[itr]); + } + } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + + h_dtRechitClusterSize_noVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_noVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_noVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_noVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_noVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_noVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_noVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_noVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_noVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_noVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } + } + + if(passMuon){ + nPassMuon+=1; + muonEff+=1.0; + h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_muonVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_muonVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_muonVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_muonVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_muonVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_muonVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_muonVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_muonVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_muonVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } + } + } + + if(passJet){ + nPassJet+=1; + jetEff+=1.0; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_jetVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_jetVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_jetVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_jetVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_jetVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_jetVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_jetVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_jetVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_jetVeto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } + } + } + + if(passMB1){ + nPassMB1+=1; + MB1Eff+=1.0; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_MB1Veto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_MB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_MB1Veto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_MB1Veto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_MB1Veto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_MB1Veto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_MB1Veto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_MB1Veto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_MB1Veto[itr_file]->Fill(match); + if(!rpcBx.empty()){ + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } + } + } + + if(passInvertedJet && passMB1){ + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + + if(passInvertedMuon && passMB1){ + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + + if(passInvertedJet && passInvertedMuon && passMB1){ + //cout << "inverted mu jet" << endl; + if(!rpcBx.empty()){ + for(Int_t itr = 0; itrFill(rpcBx[itr]); + } + } + } + //cout << "done inverted" << endl; + + if(passMuon && passJet){ + //cout << "no MB1" << endl; + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); + h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file]->Fill(float(dtRechitClusterNSegmentStation1[itr_clust]) / dtRechitClusterSize[itr_clust]); + h_dtRechitClusterNStation_noMB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_nRPCMatched_noMB1Veto[itr_file]->Fill(match); + h_MB1Rechits_jetMuonVeto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); + if(!rpcLayer.empty()){ + h_RPCMatchedBxSpread_noMB1Veto[itr_file]->Fill(max_element(rpcBx.begin(),rpcBx.end()) - min_element(rpcBx.begin(),rpcBx.end())); + for(Int_t itr = 0; itrFill(matchLayer1); + h_nRPCMatchedLayer2_noMB1Veto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedLayer12_noMB1Veto[itr_file]->Fill(matchLayer1+matchLayer2); + } + //cout << "done no MB1" << endl; + + if(passMuon && passJet && passMB1){ + passFullVeto = true; + nPassFull+=1; + fullEff+=1.0; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSize_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dPhiClusterMET_fullVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_dtRechitClusterXSpread_fullVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_fullVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_fullVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_nRPCMatched_fullVeto[itr_file]->Fill(match); + + h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); + h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); + h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); + h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); + + h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); + + //h_gLLP_travel_time_fullVeto[itr_file]->Fill(gLLP_travel_time[llp_itr]); + //h_gLLPpt_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); + if(!rpcBx.empty()){ + rpcMean = accumulate(rpcBx.begin(), rpcBx.end(), 0.0) / rpcBx.size(); + //if(abs(rpcMean)<0.5){ h_gLLPpt_Bx0_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } + //else if(rpcMean < 1.5){ h_gLLPpt_Bx1_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + for(Int_t itr = 0; itrFill(rpcBx[itr]); + if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } + } + h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); + if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } + } + + h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); + + if(!rpcBx.empty()){ + passRPCMatch = true; + h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_muonDR_RPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_RPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread = true; + h_dtRechitClusterSize_RPCSpread0[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_muonDR_RPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_RPCSpread0[itr_file]->Fill(jetDR_min); + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation = true; + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi = true; + totalClusteredFullPlus+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterXSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); + h_dtRechitClusterYSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); + h_dtRechitClusterZSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); + h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); + h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); + h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); + h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); + h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); + h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + //h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); + } + } + } + } + + } + + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeBarrel_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + /*if(passMuon && passJet && passHO){ + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + }*/ + + if(passMuon && passMB1){ + h_jetPt_muonMB1Veto[itr_file]->Fill(jetPt_max); + } + + if(passJet && passMB1){ + h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); + } + if(passJet && passMuon && passHO){ + passFullVeto_ho = true; + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); + h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); + h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); + + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); + + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); + + if(!rpcBx.empty()){ + passRPCMatch_ho = true; + h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread_ho = true; + h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi_ho = true; + totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); + h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); + h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); + h_jetEta_minDR_fullHOVetoPlus[itr_file]->Fill(jetEta[jetDR_index]); + h_jetPhi_minDR_fullHOVetoPlus[itr_file]->Fill(jetPhi[jetDR_index]); + h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); + h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); + h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); + h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); + } + } + } + } + } + } + if(passFullVeto_ho){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch_ho){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread_ho){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi_ho){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + if(passNoVeto){ nPassNoVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passFullVeto){ nPassFullVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch){ nPassRPCMatch += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread){ nPassRPCSpread += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passMaxStation){ nPassMaxStation += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi){ nPassDeltaPhi += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); + h_nDtRechitClusters_muonVeto[itr_file]->Fill(nPassMuon); + h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); + h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); + h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); + + if(nPassNone>0){ h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETBarrel_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETBarrel_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETBarrel_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETBarrel_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); } + //h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); + //h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); + h_nTotalClusteredRechitsBarrel_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsBarrel_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsBarrel_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsBarrel_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + + h_dPhiClusterMETMax[itr_file]->Fill(dPhiClusterMET_max); + + h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); + } + } + + /*if(*MET>200 && magnetDecay){ + nPassHODecay+=1; + totalMagnetEvents+=1; + passNoVeto = false; + passFullVeto = false; + passRPCMatch = false; + passRPCSpread = false; + passMaxStation = false; + passDeltaPhi = false; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + goodJets=0; + totalSumE=0.0; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + totalClusteredFullHOPlus = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + h_dPhiJetMETMagnet[itr_file]->Fill(fabs(dPhi_min)); + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + nPassJetMET+=1; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + passNoVeto = true; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ + match+=1; + rpcBx.push_back(RPCRechitBx[itr_rpc]); + rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); + } + } + rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); + if(!rpcLayer.empty()){ + for(Int_t itr = 0; itr TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(passJet){ + h_dRClusterHO_jetVeto[itr_file]->Fill(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))); + } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(passJet){ + h_HOEnergy_jetVeto[itr_file]->Fill(sumE); + } + if(sumE>40.){ passHO = true; } + + muonPt_max = 0.0; + muonDR_min = 999.0; + for(Int_t itr=0; itr<*nMuons; itr++){ + dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(muonPt[itr]>muonPt_max){ + muonPt_max=muonPt[itr]; + } + } + if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ + if(jetPt[itr]>jetPt_max){ + jetPt_max=jetPt[itr]; + } + } + if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))50){ + + nPassNone+=1; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + if(passMuon){ + nPassMuon+=1; + } + if(passJet){ + nPassJet+=1; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_nRPCMatchedMagnet_jetVeto[itr_file]->Fill(match); + + h_nRPCMatchedMagnetLayer1_jetVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_jetVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_jetVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_jetVeto[itr_file]->Fill(matchLayer4); + } + if(passMB1){ + nPassMB1+=1; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon){ + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_HOEnergy_jetMuonVeto[itr_file]->Fill(sumE); + if(dtRechitClusterSize[itr_clust]>=280){ + totalSumE+=sumE; + } + } + if(passJet && passHO){ + h_muonPt_jetHOVeto[itr_file]->Fill(muonPt_max); + } + if(passMuon && passHO){ + h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); + } + if(passJet && passMuon && passMB1){ + nPassFull+=1; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passHO){ + passFullVeto = true; + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); + h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); + h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); + h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); + + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); + h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); + + h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); + h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); + h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); + h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); + + if(!rpcBx.empty()){ + passRPCMatch = true; + h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); + if(rpcSpread==0){ + passRPCSpread = true; + h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); + h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); + if(fabs(dPhiClusterMET)<1){ + passDeltaPhi = true; + totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; + } + } + } + } + } + } + h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file]->Fill(totalSumE); + + if(passNoVeto){ nPassNoVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passFullVeto){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCMatch){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passRPCSpread){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + if(passDeltaPhi){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } + + if(nPassNone>0){ h_dPhiJetMETMagnet_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETMagnet_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETMagnet_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETMagnet_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETMagnet_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETMagnet_fullVeto[itr_file]->Fill(dPhi_min); } + if(nPassFullHO>0){ h_dPhiJetMETMagnet_fullHOVeto[itr_file]->Fill(dPhi_min); } + + h_nTotalClusteredRechitsMagnet_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsMagnet_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsMagnet_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsMagnet_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); + } + }*/ + /*if(*MET>200){ + totalEvents+=1; + nPassMuon = 0; + nPassJet = 0; + nPassJetMuon = 0; + nPassMB1 = 0; + nPassHO = 0; + nPassFull = 0; + nPassFullHO = 0; + nPassNone = 0; + goodJets=0; + totalSumE=0.0; + totalClusteredNone = 0; + totalClusteredNoMB1 = 0; + totalClusteredJet = 0; + totalClusteredMB1 = 0; + totalClusteredHO = 0; + totalClusteredFull = 0; + totalClusteredFullHO = 0; + dPhiClusterMET_max = -1.; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + jetPt_tmp = jetPt[itr_jet]; + } + goodJets+=1; + if(goodJets==4){ break; } + } + } + if(fabs(dPhi_min)>0.6){ + //if(fabs(dPhiClusterMET_max)<1.0){ + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + match = 0; + matchLayer1 = 0; + matchLayer2 = 0; + matchLayer3 = 0; + matchLayer4 = 0; + matchHO = 0; + sumE = 0; + weightT = 0; + rpcBx.clear(); + rpcLayer.clear(); + zWheel.clear(); + matchJet = false; + matchMuon = false; + goodEvt = true; + passMuon = false; + passJet = false; + passMB1 = false; + passHO = false; + passInvertedJet = false; + passInvertedMuon = false; + passInvertedMuJet = false; + llp_itr = -1; + + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } + else{ llp_itr = 1; } + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + else{ passInvertedJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + else{ passInvertedMuon = true; } + if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } + + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ + dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + matchHO+=1; + sumE += HORechitE[itr_ho]; + weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; + } + } + if(sumE>40.){ passHO = true; } + + if(dtRechitClusterSize[itr_clust]>50){ + + nPassNone+=1; + totalClusteredNone+=dtRechitClusterSize[itr_clust]; + + if(passMuon){ + nPassMuon+=1; + } + if(passJet){ + nPassJet+=1; + totalClusteredJet+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passMB1){ + nPassMB1+=1; + totalClusteredMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon){ + nPassJetMuon+=1; + totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passMB1){ + nPassFull+=1; + totalClusteredFull+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passHO){ + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passJet && passMuon && passHO){ + nPassFullHO+=1; + totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; + h_dtRechitClusterSizeAll_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + } + } + } + if(nPassNone>0){ h_dPhiJetMETAll_noVeto[itr_file]->Fill(dPhi_min); } + if(nPassMuon>0){ h_dPhiJetMETAll_muonVeto[itr_file]->Fill(dPhi_min); } + if(nPassJet>0){ h_dPhiJetMETAll_jetVeto[itr_file]->Fill(dPhi_min); } + if(nPassMB1>0){ h_dPhiJetMETAll_MB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassJetMuon>0){ h_dPhiJetMETAll_noMB1Veto[itr_file]->Fill(dPhi_min); } + if(nPassFull>0){ h_dPhiJetMETAll_fullVeto[itr_file]->Fill(dPhi_min); } + + h_nTotalClusteredRechitsAll_noVeto[itr_file]->Fill(totalClusteredNone); + h_nTotalClusteredRechitsAll_jetVeto[itr_file]->Fill(totalClusteredJet); + h_nTotalClusteredRechitsAll_MB1Veto[itr_file]->Fill(totalClusteredMB1); + h_nTotalClusteredRechitsAll_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); + h_nTotalClusteredRechitsAll_HOVeto[itr_file]->Fill(totalClusteredHO); + h_nTotalClusteredRechitsAll_fullVeto[itr_file]->Fill(totalClusteredFull); + h_nTotalClusteredRechitsAll_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); + } + }*/ + evtNum+=1; + } + + } + //cout << "Total events = " << totalEvents << endl; + //cout << "Total magnet events = " << totalMagnetEvents << endl; + //cout << "Total barrel events = " << totalBarrelEvents << endl; + + cout << "MET > 200: " << nPassMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + //cout << "DT Decay: " << nPassDTDecay * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "No Veto: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Full Veto: " << nPassFullVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "nRPC Matched > 0: " << nPassRPCMatch * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "RPC Spread = 0: " << nPassRPCSpread * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Max Station > 2: " << nPassMaxStation * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << " " << endl; + //cout << "HO Decay: " << nPassHODecay * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "No Veto: " << nPassNoVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "Full Veto: " << nPassFullVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "nRPC Matched > 0: " << nPassRPCMatch_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "RPC Spread = 0: " << nPassRPCSpread_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << " " << endl; + + itr_file+=1; + } + + _ofile->Write(); + _ofile->Close(); + +} From 1cbb5fcef707ff565c160ff6318f5d2f59dc0f07 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 13:47:35 -0500 Subject: [PATCH 04/15] put in helpers file --- README.md | 4 + analyzeData.C | 171 +++++++++++++---------------- analyzeData_ABCD.C | 121 +++++++++----------- analyzeSignal.C | 255 ++++++++++++++++++++----------------------- analyzeSignal_ABCD.C | 104 ++++++------------ helpers.h | 31 ++++++ 6 files changed, 315 insertions(+), 371 deletions(-) create mode 100644 helpers.h diff --git a/README.md b/README.md index 7cbd5e9..bceec55 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,7 @@ cmsenv git cms-init git clone git@github.com:dildick/dt_analysis_code.git + +Running the signal analysis + +root -l -q -b analyzeSignal.C++ \ No newline at end of file diff --git a/analyzeData.C b/analyzeData.C index b997e86..f042336 100644 --- a/analyzeData.C +++ b/analyzeData.C @@ -1,45 +1,26 @@ R__LOAD_LIBRARY(libTreePlayer) -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} +#include "helpers.h" + +void analyzeData(){ -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; } - else{ - return -1*getWheel(-1.0*hitZ); + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} - -void analyzeData_tmp(){ char name[50]; char title[100]; char years[4][10] = {"2018","2017","2016"}; char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; char dates[3][20] = {"17Sep2018","17Nov2017_v2","07Aug17"}; - TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/Data"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/Data"); TFile *_ofile = TFile::Open("outData_altTest4.root","RECREATE"); TH1D *h_dPhiJetMET[4]; @@ -87,7 +68,7 @@ void analyzeData_tmp(){ TH1D *h_RPCMatchedBxSpread_muonVeto[4]; TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; TH1D *h_nRPCMatched_Spread0_muonVeto[4]; - + TH1D *h_nDtRechitClusters_jetVeto[4]; TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; @@ -414,7 +395,7 @@ void analyzeData_tmp(){ Bool_t passMB1_alt = false; Bool_t passMuon_alt = false; Bool_t passHO = false; - Bool_t passInvertedJet = false; + Bool_t passInvertedJet = false; Bool_t passInvertedMuon = false; Bool_t passInvertedMuJet = false; Int_t nPassMuon = 0; @@ -452,10 +433,10 @@ void analyzeData_tmp(){ Int_t totalClusteredHO = 0; Int_t totalClusteredFull = 0; Int_t totalClusteredFullHO = 0; - + Int_t totalClusteredFullPlus = 0; Int_t totalClusteredFullHOPlus = 0; - + Int_t nPassMET = 0; Int_t nPassDecayDT = 0; Int_t nPassDecayHO = 0; @@ -509,7 +490,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiJetMET_fullHOVeto_%s",years[itr_year]); h_dPhiJetMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_MET_%s",years[itr_year]); h_MET[itr_file] = new TH1D(name,"",100,0,1000); @@ -533,7 +514,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiClusterMET_noVeto_%s",years[itr_year]); h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s",years[itr_year]); h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -581,7 +562,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiClusterMET_muonVeto_%s",years[itr_year]); h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s",years[itr_year]); h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -629,7 +610,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiClusterMET_jetVeto_%s",years[itr_year]); h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s",years[itr_year]); h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -704,7 +685,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiClusterMET_MB1Veto_%s",years[itr_year]); h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s",years[itr_year]); h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); @@ -773,7 +754,7 @@ void analyzeData_tmp(){ sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s",years[itr_year]); h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s",years[itr_year]); h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -911,7 +892,7 @@ void analyzeData_tmp(){ sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s",years[itr_year]); h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - + sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s",years[itr_year]); h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); @@ -950,7 +931,7 @@ void analyzeData_tmp(){ sprintf(name,"h_nTotalClusteredRechits_fullHOVeto_%s",years[itr_year]); h_nTotalClusteredRechits_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - + sprintf(name,"h_nTotalClusteredRechits_fullVetoPlus_%s",years[itr_year]); h_nTotalClusteredRechits_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); @@ -1238,7 +1219,7 @@ void analyzeData_tmp(){ sprintf(name,"h_nWheels150_fullVetoMinus_%s",years[itr_year]); h_nWheels150_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - + sprintf(name,"h_jetPtMax_noVeto_%s",years[itr_year]); h_jetPtMax_noVeto[itr_file] = new TH1D(name,"",20,0,200); @@ -1290,7 +1271,7 @@ void analyzeData_tmp(){ } TTreeReader treeReader("MuonSystem",_file); - + TTreeReaderValue runNum(treeReader,"runNum"); TTreeReaderValue lumiSec(treeReader,"lumiSec"); TTreeReaderValue eventNum(treeReader,"evtNum"); @@ -1298,7 +1279,7 @@ void analyzeData_tmp(){ TTreeReaderValue MET(treeReader,"met"); TTreeReaderValue METphi(treeReader,"metPhi"); TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); - + TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); @@ -1347,7 +1328,7 @@ void analyzeData_tmp(){ TTreeReaderArray muonEta(treeReader,"muonEta"); TTreeReaderArray muonPhi(treeReader,"muonPhi"); TTreeReaderArray muonPt(treeReader,"muonPt"); - + TTreeReaderValue nRPCRechits(treeReader,"nRpc"); TTreeReaderArray RPCRechitX(treeReader,"rpcX"); TTreeReaderArray RPCRechitY(treeReader,"rpcY"); @@ -1360,7 +1341,7 @@ void analyzeData_tmp(){ TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); - + _ofile->cd(); evtNum = 0; cout << "Data" << years[itr_year] << endl; @@ -1406,7 +1387,7 @@ void analyzeData_tmp(){ totalClusteredFullPlus = 0; totalClusteredFullHOPlus = 0; if(evtNum%100000==0){ cout << evtNum << " of " << treeReader.GetEntries(1) << endl; } - + if(*MET > 200){ nPassMET+=1; h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); @@ -1424,8 +1405,8 @@ void analyzeData_tmp(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); jetPt_tmp = jetPt[itr_jet]; if(goodJets<4){ dPhi_minTop4 = fabs(dPhi_tmp); } if(jetPt[itr_jet]>50.0){ dPhi_min50 = fabs(dPhi_tmp); } @@ -1442,7 +1423,7 @@ void analyzeData_tmp(){ if(fabs(dPhi_min50)>0.6 && fabs(dPhi_min50)<999.){ failJetMET_50 += true; } if(fabs(dPhi_min30)>0.6 && fabs(dPhi_min30)<999.){ failJetMET_30 += true; } if(fabs(dPhi_min20)>0.6 && fabs(dPhi_min20)<999.){ failJetMET_20 += true; } - + dPhi_min=dPhi_minTop4; if(dPhi_min!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } if(fabs(dPhi_min)<0.6){ @@ -1516,7 +1497,7 @@ void analyzeData_tmp(){ passInvertedJet = false; passInvertedMuon = false; passInvertedMuJet = false; - + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } @@ -1540,7 +1521,7 @@ void analyzeData_tmp(){ if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } else{ passInvertedMuon = true; } if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - + passMB1_alt = true; for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ @@ -1561,9 +1542,9 @@ void analyzeData_tmp(){ } } //if(*nLeptons==0){ passMuon_alt = true; } - + if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - + nPassNone+=1; totalClusteredNone+=dtRechitClusterSize[itr_clust]; @@ -1608,7 +1589,7 @@ void analyzeData_tmp(){ h_HOEnergy_jetVeto[itr_file]->Fill(sumE); } if(sumE>40.){ passHO = true; } - + muonPt_max = 0.0; muonDR_min = 999.0; for(Int_t itr=0; itr<*nMuons; itr++){ @@ -1670,9 +1651,9 @@ void analyzeData_tmp(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } } - + if(passMuon){ nPassMuon+=1; h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); @@ -1692,7 +1673,7 @@ void analyzeData_tmp(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } } } @@ -1722,7 +1703,7 @@ void analyzeData_tmp(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } } } @@ -1746,7 +1727,7 @@ void analyzeData_tmp(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } } } @@ -1875,7 +1856,7 @@ void analyzeData_tmp(){ h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); h_dtRechitClusterNThreshStation_fullVeto[itr_file]->Fill(nThreshStation); - + h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); h_dtRechitClusterNStationUnclustered_fullVeto[itr_file]->Fill(nStationUnclustered); h_dtRechitClusterNThreshStation_fullVeto[itr_file]->Fill(nThreshStation); @@ -1889,7 +1870,7 @@ void analyzeData_tmp(){ h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); h_nRPCMatched_fullVeto[itr_file]->Fill(match); - + h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); @@ -1898,8 +1879,8 @@ void analyzeData_tmp(){ h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); h_dtRechitClusterEtaPhi_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust],dtRechitClusterPhi[itr_clust]); h_dtRechitClusterEtaPhiFine_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust],dtRechitClusterPhi[itr_clust]); - - if(dtRechitClusterPhi[itr_clust]>0.4 && dtRechitClusterPhi[itr_clust]<0.6){ + + if(dtRechitClusterPhi[itr_clust]>0.4 && dtRechitClusterPhi[itr_clust]<0.6){ h_runNum_phi->Fill(*runNum); if(dtRechitClusterEta[itr_clust]>0.5 && dtRechitClusterEta[itr_clust]<0.6){ h_runNum_etaphi->Fill(*runNum); @@ -1913,12 +1894,12 @@ void analyzeData_tmp(){ h_badRun_dtRechitClusterXSpread->Fill(dtRechitClusterXSpread[itr_clust]); h_badRun_dtRechitClusterYSpread->Fill(dtRechitClusterYSpread[itr_clust]); h_badRun_dtRechitClusterPhiSpread->Fill(dtRechitClusterPhiSpread[itr_clust]); - } + } } - if(dtRechitClusterEta[itr_file]>0.5 && dtRechitClusterEta[itr_file]<0.6){ + if(dtRechitClusterEta[itr_file]>0.5 && dtRechitClusterEta[itr_file]<0.6){ h_runNum_eta->Fill(*runNum); } - + h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); if(!rpcBx.empty()){ @@ -1930,9 +1911,9 @@ void analyzeData_tmp(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } } - + h_nHOMatched_fullVeto[itr_file]->Fill(matchHO); if(sumE>20.){ h_HOMatchedEnergy_fullVeto[itr_file]->Fill(sumE); @@ -1941,10 +1922,10 @@ void analyzeData_tmp(){ h_HOMatchedTime_RPCMatchedBx_fullVeto[itr_file]->Fill(weightT/sumE,rpcMedian); } } - + h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); - + if(!rpcBx.empty()){ nPassRPCMatch_dt+=1; h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); @@ -2027,7 +2008,7 @@ void analyzeData_tmp(){ } } } - + if(passMuon_alt){ nPassMuon_alt+=1; if(passJet && passMB1_alt){ @@ -2066,12 +2047,12 @@ void analyzeData_tmp(){ } if(passHO){ - nPassHO+=1; + nPassHO+=1; totalClusteredHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSize_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } if(passJet && passMuon && passHO){ - nPassFullHO+=1; + nPassFullHO+=1; totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSize_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); @@ -2081,7 +2062,7 @@ void analyzeData_tmp(){ h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); + h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); h_nRPCMatchedLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); h_nRPCMatchedLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); @@ -2091,11 +2072,11 @@ void analyzeData_tmp(){ if(!rpcBx.empty()){ nPassRPCMatch_ho+=1; h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); + h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); if(rpcSpread==0){ nPassRPCSpread_ho+=1; h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); + h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); if(fabs(dPhiClusterMET)<1){ nPassDeltaPhi_ho+=1; totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; @@ -2150,7 +2131,7 @@ void analyzeData_tmp(){ if(passMuon && passHO){ h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); } - + } } h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); @@ -2159,9 +2140,9 @@ void analyzeData_tmp(){ h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); - if(nPassNone>0){ + if(nPassNone>0){ nPassCluster+=1; - h_dPhiJetMET_noVeto[itr_file]->Fill(dPhi_min); + h_dPhiJetMET_noVeto[itr_file]->Fill(dPhi_min); h_nWheels1_noVeto[itr_file]->Fill(hitWheels1); h_nWheels10_noVeto[itr_file]->Fill(hitWheels10); h_nWheels20_noVeto[itr_file]->Fill(hitWheels20); @@ -2175,11 +2156,11 @@ void analyzeData_tmp(){ if(nPassJet>0){ h_dPhiJetMET_jetVeto[itr_file]->Fill(dPhi_min); } if(nPassMB1>0){ h_dPhiJetMET_MB1Veto[itr_file]->Fill(dPhi_min); } if(nPassJetMuon>0){ h_dPhiJetMET_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ + if(nPassFull>0){ nPassFullDT+=1; h_dPhiJetMET_fullVeto[itr_file]->Fill(dPhi_min); h_jetPtMET_fullVeto[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVeto[itr_file]->Fill(jetPt[0]); + h_jetPtMax_fullVeto[itr_file]->Fill(jetPt[0]); } if(nPassFullPlus>0){ h_nWheels1_fullVetoPlus[itr_file]->Fill(hitWheels1); @@ -2189,7 +2170,7 @@ void analyzeData_tmp(){ h_nWheels50_fullVetoPlus[itr_file]->Fill(hitWheels50); h_nWheels150_fullVetoPlus[itr_file]->Fill(hitWheels150); h_jetPtMET_fullVetoPlus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoPlus[itr_file]->Fill(jetPt[0]); + h_jetPtMax_fullVetoPlus[itr_file]->Fill(jetPt[0]); } if(nPassFullMinus>0){ h_nWheels1_fullVetoMinus[itr_file]->Fill(hitWheels1); @@ -2199,12 +2180,12 @@ void analyzeData_tmp(){ h_nWheels50_fullVetoMinus[itr_file]->Fill(hitWheels50); h_nWheels150_fullVetoMinus[itr_file]->Fill(hitWheels150); h_jetPtMET_fullVetoMinus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoMinus[itr_file]->Fill(jetPt[0]); + h_jetPtMax_fullVetoMinus[itr_file]->Fill(jetPt[0]); } h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); - + h_nTotalClusteredRechits_noVeto[itr_file]->Fill(totalClusteredNone); h_nTotalClusteredRechits_jetVeto[itr_file]->Fill(totalClusteredJet); h_nTotalClusteredRechits_MB1Veto[itr_file]->Fill(totalClusteredMB1); @@ -2217,8 +2198,8 @@ void analyzeData_tmp(){ h_nTotalClusteredRechits_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); h_HOMatchedEnergyCluster280_noMB1Veto[itr_file]->Fill(totalSumE); - } - + } + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ match = 0; matchLayer1 = 0; @@ -2243,19 +2224,19 @@ void analyzeData_tmp(){ passInvertedJet = false; passInvertedMuon = false; passInvertedMuJet = false; - + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } else{ passInvertedJet = true; } if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } else{ passInvertedMuon = true; } if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - + if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } @@ -2269,7 +2250,7 @@ void analyzeData_tmp(){ if(!rpcBx.empty()){ rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); } - + if(rpcBx.empty() || rpcSpread>0){ nPassNone+=1; if(passJet && passMuon && passMB1){ @@ -2303,7 +2284,7 @@ void analyzeData_tmp(){ } itr_file+=1; - + cout << "MET > 200: " << nPassMET << endl; cout << "full Plus RPC CR: " << nPassFullPlus_rpcCR << endl; diff --git a/analyzeData_ABCD.C b/analyzeData_ABCD.C index 6703759..82bb57b 100644 --- a/analyzeData_ABCD.C +++ b/analyzeData_ABCD.C @@ -1,45 +1,26 @@ R__LOAD_LIBRARY(libTreePlayer) -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} +#include "helpers.h" + +void analyzeData_ABCD(){ -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; } - else{ - return -1*getWheel(-1.0*hitZ); + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} - -void analyzeData_ABCD(){ char name[50]; char title[100]; char years[4][10] = {"2018","2017","2016"}; char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; - TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); //TString dir("/storage/user/mcitron/skims/"); TFile *_ofile = TFile::Open("outData_ABCD.root","RECREATE"); @@ -53,7 +34,7 @@ void analyzeData_ABCD(){ TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto[4]; TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[4]; TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[4]; - + TH1D *h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[4]; TH1D *h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto[4]; TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[4]; @@ -161,7 +142,7 @@ void analyzeData_ABCD(){ Bool_t passMuon_alt = false; Bool_t passMB1 = false; Bool_t passJet = false; - + Bool_t passClusterCR = false; Bool_t passNoVeto_clusterCR = false; Bool_t passFullVeto_clusterCR = false; @@ -169,8 +150,8 @@ void analyzeData_ABCD(){ Bool_t passRPCSpread_clusterCR = false; Bool_t passRPCBx_clusterCR = false; Bool_t passMaxStation_clusterCR = false; - - Bool_t passNoVeto = false; + + Bool_t passNoVeto = false; Bool_t passFullVeto_rpcCR = false; Bool_t passRPCCR = false; Bool_t passClusterMET_rpcCR = false; @@ -184,8 +165,8 @@ void analyzeData_ABCD(){ Int_t nPassRPCSpread_clusterCR = 0; Int_t nPassRPCBx_clusterCR = 0; Int_t nPassMaxStation_clusterCR = 0; - - Int_t nPassNoVeto = 0; + + Int_t nPassNoVeto = 0; Int_t nPassFullVeto_rpcCR = 0; Int_t nPassRPCCR = 0; Int_t nPassClusterMET_rpcCR = 0; @@ -343,7 +324,7 @@ void analyzeData_ABCD(){ sprintf(name,"h_dtRechitClusterSize_rpcNoMatch_clusterMETCRnoLepton_%s",years[itr_year]); h_dtRechitClusterSize_rpcNoMatch_clusterMETCRnoLepton[itr_year] = new TH1D(name,"",50,0,500); - + sprintf(name,"h_dPhiClusterRPC_fullVeto_%s",years[itr_year]); h_dPhiClusterRPC_fullVeto[itr_year] = new TH1D(name,"",73,-0.15,3.5); @@ -362,8 +343,8 @@ void analyzeData_ABCD(){ sprintf(name,"h_rpcSpread_fullVeto_negBx_%s",years[itr_year]); h_rpcSpread_fullVeto_negBx[itr_year] = new TH1D(name,"",10,0,10); - - + + sprintf(name,"h_nRPCMatched_fullVeto_clusterMETCR_%s",years[itr_year]); h_nRPCMatched_fullVeto_clusterMETCR[itr_year] = new TH1D(name,"",20,0,20); @@ -394,7 +375,7 @@ void analyzeData_ABCD(){ sprintf(name,"h_dtRechitClusterMaxStation_Nminus1_clusterMETCR_%s",years[itr_year]); h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_year] = new TH1D(name,"",5,0,5); - + sprintf(name,"h_dPhiClusterMET_fullVeto_rpcCR_%s",years[itr_year]); h_dPhiClusterMET_fullVeto_rpcCR[itr_year] = new TH1D(name,"",35,0,3.5); @@ -535,7 +516,7 @@ void analyzeData_ABCD(){ } TTreeReader treeReader("MuonSystem",_file); - + TTreeReaderValue runNum(treeReader,"runNum"); TTreeReaderValue lumiSec(treeReader,"lumiSec"); TTreeReaderValue eventNum(treeReader,"evtNum"); @@ -601,7 +582,7 @@ void analyzeData_ABCD(){ event150_rpc = 0; event100_clusterMET = 0; event150_clusterMET = 0; - + cout << "Data" << years[itr_year] << endl; while(treeReader.Next()){ if(evtNum%100000==0){ cout << evtNum << " of " << treeReader.GetEntries(1) << endl; } @@ -615,7 +596,7 @@ void analyzeData_ABCD(){ passClusterMET_rpcCR = false; passMaxStation_rpcCR = false; maxClusterSize=0; - + if(*MET > 200){ dPhi_min = 999.; dPhiClusterMET = 0.0; @@ -634,8 +615,8 @@ void analyzeData_ABCD(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); } } } @@ -643,7 +624,7 @@ void analyzeData_ABCD(){ if(fabs(dPhiClusterMET)>1.0){ nPassClusterCR+=1; } for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ - + if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ passMuon=false; passMuon_alt=false; @@ -653,15 +634,15 @@ void analyzeData_ABCD(){ rpcMedian = 99; dPhiClusterRPC = -0.1; dZClusterRPC = -1.; - + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } if(*nLeptons==0){ passMuon_alt = true; } - + passMB1 = true; for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ @@ -675,7 +656,7 @@ void analyzeData_ABCD(){ } } if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } - + //cout << "doing rpc" << endl; for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; @@ -710,23 +691,23 @@ void analyzeData_ABCD(){ } } } - + if(passJet && passMB1){ - if(passMuon){ - h_dPhiClusterRPC_fullVeto[itr_year]->Fill(dPhiClusterRPC); - h_dZClusterRPC_fullVeto[itr_year]->Fill(dZClusterRPC); + if(passMuon){ + h_dPhiClusterRPC_fullVeto[itr_year]->Fill(dPhiClusterRPC); + h_dZClusterRPC_fullVeto[itr_year]->Fill(dZClusterRPC); } //cout << "doing CRs" << endl; if(fabs(dPhi_min)<0.6 && dtRechitClusterMaxStation[itr_clust]>2){ if(!rpcBx.empty() && rpcSpread==0){ if(fabs(dPhiClusterMET)<1.0){ - if(passMuon){ + if(passMuon){ h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ + if(passMuon_alt){ h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } @@ -748,7 +729,7 @@ void analyzeData_ABCD(){ if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ if(!rpcBx.empty() && rpcSpread==0){ if(fabs(dPhi_min)>0.6){ - if(passMuon){ + if(passMuon){ h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); if(event100_clusterMET<4 && dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150){ @@ -760,7 +741,7 @@ void analyzeData_ABCD(){ event150_clusterMET+=1; } } - if(passMuon_alt){ + if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterSize_rpcMatch_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } @@ -782,7 +763,7 @@ void analyzeData_ABCD(){ if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ if(fabs(dPhi_min)>0.6){ if(passMuon){ - if(!rpcBx.empty()){ + if(!rpcBx.empty()){ h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); if(rpcSpread==0){ h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); @@ -829,15 +810,15 @@ void analyzeData_ABCD(){ if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_year]->Fill(rpcMedian); } if(!rpcBx.empty() && rpcMedian>=0. && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcSpread_Nminus1_clusterMETCR[itr_year]->Fill(rpcSpread); } if(dtRechitClusterMaxStation[itr_clust]>2){ h_nRPCMatched_Nminus1_clusterMETCR[itr_year]->Fill(rpcBx.size()); } - } - + } + //cout << "doing rpc CRs" << endl; if((rpcBx.empty() || rpcSpread>0) && dtRechitClusterMaxStation[itr_clust]>2){ if(fabs(dPhi_min)>0.6){ - if(passMuon){ + if(passMuon){ h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(fabs(dPhiClusterMET<1.0)){ - h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(fabs(dPhiClusterMET<1.0)){ + h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); if(dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150 && event100_rpc<5){ eventListRPC << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; event100_rpc+=1; @@ -849,7 +830,7 @@ void analyzeData_ABCD(){ } else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } } - if(passMuon_alt){ + if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); if(fabs(dPhiClusterMET<1.0)){ h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } @@ -882,12 +863,12 @@ void analyzeData_ABCD(){ passMaxStation_rpcCR=true; h_dPhiClusterMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhiClusterMET)); h_dPhiJetMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhi_min)); - if(fabs(dPhiClusterMET)<1.0){ + if(fabs(dPhiClusterMET)<1.0){ passClusterMET_rpcCR=true; } } - if(fabs(dPhiClusterMET)<1.0){ - h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); + if(fabs(dPhiClusterMET)<1.0){ + h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); } } @@ -928,5 +909,5 @@ void analyzeData_ABCD(){ _ofile->Close(); eventListRPC.close(); eventListClusterMET.close(); - + } diff --git a/analyzeSignal.C b/analyzeSignal.C index 68b6e37..4c22fed 100644 --- a/analyzeSignal.C +++ b/analyzeSignal.C @@ -1,38 +1,19 @@ R__LOAD_LIBRARY(libTreePlayer) -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} +#include "helpers.h" + +void analyzeSignal(){ -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; } - else{ - return -1*getWheel(-1.0*hitZ); + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} - -void analyzeSignal(){ char name[50]; char title[100]; @@ -42,13 +23,13 @@ void analyzeSignal(){ char ctau[10] = "10000"; char years[3][20] = {"MC_Summer16","MC_Fall17","MC_Fall18"}; //TString dir("/storage/user/mcitron/signalPointsGGHWithRPCWithFlags/"); - TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); //TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/"); TFile *_ofile = TFile::Open("outSig_central_V1p17_altTest5.root","RECREATE"); Float_t lumi[3] = {37.8,44.98,63.67}; Float_t xSec = 48.58; Float_t weight; - + TH1D *h_dPhiClusterMET[4]; TH1D *h_dPhiClusterMETMax[4]; TH1D *h_dPhiJetMET[4]; @@ -111,7 +92,7 @@ void analyzeSignal(){ TH1D *h_RPCMatchedBxSpread_muonVeto[4]; TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; TH1D *h_nRPCMatched_Spread0_muonVeto[4]; - + TH1D *h_nDtRechitClusters_jetVeto[4]; TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; @@ -230,7 +211,7 @@ void analyzeSignal(){ TH1D *h_dtRechitClusterSizeBarrel_fullHOVeto[4]; TH1D *h_dtRechitClusterSizeMagnet_fullHOVeto[4]; TH1D *h_dtRechitClusterSizeAll_fullHOVeto[4]; - + TH1D *h_nTotalClusteredRechitsBarrel_noVeto[4]; TH1D *h_nTotalClusteredRechitsMagnet_noVeto[4]; TH1D *h_nTotalClusteredRechitsAll_noVeto[4]; @@ -252,7 +233,7 @@ void analyzeSignal(){ TH1D *h_nTotalClusteredRechitsBarrel_fullHOVeto[4]; TH1D *h_nTotalClusteredRechitsMagnet_fullHOVeto[4]; TH1D *h_nTotalClusteredRechitsAll_fullHOVeto[4]; - + TH1D *h_dtRechitClusterSize_RPCMatch[4]; TH1D *h_dtRechitClusterSize_RPCSpread0[4]; TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; @@ -466,7 +447,7 @@ void analyzeSignal(){ Float_t HOEff = 0.0; Float_t fullHOEff = 0.0; Float_t fullEff = 0.0; - + Bool_t goodDecay = false; Bool_t magnetDecay = false; @@ -485,7 +466,7 @@ void analyzeSignal(){ Bool_t passFullDTPlus_std = false; Bool_t passFullDTPlus_altMuon = false; Bool_t passFullDTPlus_altMB1 = false; - Bool_t passFullDTPlus_altMuonMB1 = false; + Bool_t passFullDTPlus_altMuonMB1 = false; Bool_t passNoVeto = false; Bool_t passFullVeto = false; @@ -513,12 +494,12 @@ void analyzeSignal(){ Float_t nPassJetMET_50 = 0; Float_t nPassNoVeto = 0; Float_t nPassFullVeto = 0; - + Float_t nPassMaxStation = 0; Float_t nPassDeltaPhi = 0; Float_t nPassRPCMatch = 0; Float_t nPassRPCSpread = 0; - + Float_t nPassHODecay = 0; Float_t nPassNoVeto_ho = 0; Float_t nPassFullVeto_ho = 0; @@ -544,7 +525,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiJetMETBarrel_muonVeto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETBarrel_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dPhiJetMETBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETBarrel_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); @@ -562,7 +543,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiJetMETMagnet_muonVeto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETMagnet_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dPhiJetMETMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETMagnet_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); @@ -586,7 +567,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiJetMETAll_muonVeto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETAll_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dPhiJetMETAll_MB1Veto_%s_%s",mX[itr_mX],ctau); h_dPhiJetMETAll_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); @@ -625,7 +606,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiClusterMET_noVeto_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -673,7 +654,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiClusterMET_muonVeto_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -730,7 +711,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiClusterMET_jetVeto_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -814,7 +795,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiClusterMET_MB1Veto_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); @@ -892,7 +873,7 @@ void analyzeSignal(){ sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - + sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); @@ -982,7 +963,7 @@ void analyzeSignal(){ sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s_%s",mX[itr_mX],ctau); h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - + sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); @@ -1054,7 +1035,7 @@ void analyzeSignal(){ sprintf(name,"h_nTotalClusteredRechitsAll_jetVeto_%s_%s",mX[itr_mX],ctau); h_nTotalClusteredRechitsAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - + sprintf(name,"h_nTotalClusteredRechitsBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); @@ -1111,7 +1092,7 @@ void analyzeSignal(){ sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - + sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); @@ -1383,7 +1364,7 @@ void analyzeSignal(){ HOEff=0.0; fullEff=0.0; fullHOEff=0.0; - + nPassMET=0; nPassDTDecay=0; nPassJetMET=0; @@ -1397,14 +1378,14 @@ void analyzeSignal(){ nPassMaxStation=0; nPassDeltaPhi=0; nPassRPCMatch=0; - nPassRPCSpread=0; - + nPassRPCSpread=0; + nPassHODecay=0; nPassNoVeto_ho=0; nPassFullVeto_ho=0; nPassDeltaPhi_ho=0; nPassRPCMatch_ho=0; - nPassRPCSpread_ho=0; + nPassRPCSpread_ho=0; nPassMuon_std=0; nPassMB1_std=0; @@ -1426,7 +1407,7 @@ void analyzeSignal(){ cout << mX[itr_mX] << "_" << ctau << endl; for(Int_t itr_year = 0; itr_year<3; itr_year++){ cout << " " << years[itr_year] << endl; - + TFile *_file; if(strcmp(years[itr_year],"MC_Summer16")==0){ _file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); @@ -1461,7 +1442,7 @@ void analyzeSignal(){ TTreeReaderValue MET(treeReader,"met"); TTreeReaderValue METphi(treeReader,"metPhi"); //TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); - + TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); @@ -1484,7 +1465,7 @@ void analyzeSignal(){ TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - + TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); @@ -1493,7 +1474,7 @@ void analyzeSignal(){ TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - + TTreeReaderValue nJets(treeReader,"nJets"); TTreeReaderArray jetPt(treeReader,"jetPt"); TTreeReaderArray jetEta(treeReader,"jetEta"); @@ -1509,7 +1490,7 @@ void analyzeSignal(){ TTreeReaderArray muonEta(treeReader,"muonEta"); TTreeReaderArray muonPhi(treeReader,"muonPhi"); TTreeReaderArray muonPt(treeReader,"muonPt"); - + TTreeReaderValue nRPCRechits(treeReader,"nRpc"); TTreeReaderArray RPCRechitX(treeReader,"rpcX"); TTreeReaderArray RPCRechitY(treeReader,"rpcY"); @@ -1544,7 +1525,7 @@ void analyzeSignal(){ dPhi_min30 = -999.; dPhi_min50 = -999.; if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } - + for(Int_t itr_llp=0; itr_llp<2; itr_llp++){ if(gLLP_decay_vertex_z[itr_llp] < 650.){ h_decayVertexRadius_noVeto[itr_file]->Fill(sqrt(pow(gLLP_decay_vertex_x[itr_llp],2)+pow(gLLP_decay_vertex_y[itr_llp],2))); @@ -1553,7 +1534,7 @@ void analyzeSignal(){ if(gLLP_dt[0] || gLLP_dt[1]){ goodDecay = true; } else if(sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) > 300. && abs(gLLP_decay_vertex_z[0]) < 650.){ magnetDecay = true; } else if(sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[1],2)) > 300. && abs(gLLP_decay_vertex_z[1]) < 650.){ magnetDecay = true; } - if(*MET > 200){ + if(*MET > 200){ //nPassMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); nPassMET += 1; } @@ -1585,7 +1566,7 @@ void analyzeSignal(){ passFullDTPlus_std = false; passFullDTPlus_altMuon = false; passFullDTPlus_altMB1 = false; - passFullDTPlus_altMuonMB1 = false; + passFullDTPlus_altMuonMB1 = false; passJetMET = false; passJetMET_20 = false; passJetMET_30 = false; @@ -1626,8 +1607,8 @@ void analyzeSignal(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < fabs(dPhi_min)){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < fabs(dPhi_min)){ + dPhi_min = fabs(dPhi_tmp); jetPt_tmp = jetPt[itr_jet]; if(goodJets<4){ dPhi_minTop4 = fabs(dPhi_tmp); } if(jetPt[itr_jet]>50.0){ dPhi_min50 = fabs(dPhi_tmp); } @@ -1647,7 +1628,7 @@ void analyzeSignal(){ if(fabs(dPhi_minTop4)>0.6){ passJetMET_top4 += true; } if(fabs(dPhi_minTop4)>0.0){ //if(fabs(dPhiClusterMET_max)<1.0){ - //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); + //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); //nPassJetMET_top4 += 1; h_MET[itr_file]->Fill(*MET); h_jetPt[itr_file]->Fill(jetPt_tmp); @@ -1690,9 +1671,9 @@ void analyzeSignal(){ fill_n(stationCount, 4, 0); nStationUnclustered = 0; nThreshStation = 0; - nThreshLowStation = 0; + nThreshLowStation = 0; nThreshStationUnclustered = 0; - nThreshLowStationUnclustered = 0; + nThreshLowStationUnclustered = 0; sumE = 0; weightT = 0; rpcBx.clear(); @@ -1762,7 +1743,7 @@ void analyzeSignal(){ noEff+=1.0; totalClusteredNone+=dtRechitClusterSize[itr_clust]; - + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; @@ -1786,7 +1767,7 @@ void analyzeSignal(){ } } if(sumE>40.){ passHO = true; } - + muonPt_max = 0.0; muonDR_min = 999.0; for(Int_t itr=0; itr<*nMuons; itr++){ @@ -1860,9 +1841,9 @@ void analyzeSignal(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } } - + if(passMuon){ nPassMuon+=1; muonEff+=1.0; @@ -1883,7 +1864,7 @@ void analyzeSignal(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } } } @@ -1909,7 +1890,7 @@ void analyzeSignal(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } } } @@ -1935,7 +1916,7 @@ void analyzeSignal(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } } } @@ -2046,10 +2027,10 @@ void analyzeSignal(){ h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - + h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); - + //h_gLLP_travel_time_fullVeto[itr_file]->Fill(gLLP_travel_time[llp_itr]); //h_gLLPpt_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); if(!rpcBx.empty()){ @@ -2062,12 +2043,12 @@ void analyzeSignal(){ if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } } h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } + if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } } h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); - + if(!rpcBx.empty()){ passRPCMatch = true; h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); @@ -2093,7 +2074,7 @@ void analyzeSignal(){ h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); - h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); //h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); } @@ -2163,16 +2144,16 @@ void analyzeSignal(){ } } } - - if(passHO){ + + if(passHO){ nPassHO+=1; totalClusteredHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeBarrel_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - /*if(passMuon && passJet && passHO){ - nPassFullHO+=1; + /*if(passMuon && passJet && passHO){ + nPassFullHO+=1; totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); }*/ if(passMuon && passMB1){ @@ -2182,17 +2163,17 @@ void analyzeSignal(){ if(passJet && passMB1){ h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); } - if(passJet && passMuon && passHO){ + if(passJet && passMuon && passHO){ passFullVeto_ho = true; - nPassFullHO+=1; + nPassFullHO+=1; totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); @@ -2212,7 +2193,7 @@ void analyzeSignal(){ if(fabs(dPhiClusterMET)<1){ passDeltaPhi_ho = true; totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); + h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); @@ -2239,7 +2220,7 @@ void analyzeSignal(){ if(passRPCSpread){ nPassRPCSpread += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } if(passMaxStation){ nPassMaxStation += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } if(passDeltaPhi){ nPassDeltaPhi += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - + if(passJetMuon_std){ nPassJetMuon_std += 1; } if(passJetMB1_std){ nPassJetMB1_std += 1; } if(passMuonEvent_std){ nPassMuon_std += 1; } @@ -2252,8 +2233,8 @@ void analyzeSignal(){ if(passFull_altMuonMB1){ nPassFull_altMuonMB1 += 1; } if(passFullDTPlus_noMuon){ nPassFullDTPlus_noMuon += 1; } if(passFullDTPlus_noMB1){ nPassFullDTPlus_noMB1 += 1; } - if(passFullDTPlus_std){ - nPassFullDTPlus_std += 1; + if(passFullDTPlus_std){ + nPassFullDTPlus_std += 1; if(passJetMET){ nPassJetMET += 1; } if(passJetMET_20){ nPassJetMET_20 += 1; } if(passJetMET_30){ nPassJetMET_30 += 1; } @@ -2269,9 +2250,9 @@ void analyzeSignal(){ h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); - - if(nPassNone>0){ - h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); + + if(nPassNone>0){ + h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); h_nWheels1_noVeto[itr_file]->Fill(hitWheels1); h_nWheels10_noVeto[itr_file]->Fill(hitWheels10); h_nWheels20_noVeto[itr_file]->Fill(hitWheels20); @@ -2285,8 +2266,8 @@ void analyzeSignal(){ if(nPassJet>0){ h_dPhiJetMETBarrel_jetVeto[itr_file]->Fill(dPhi_min); } if(nPassMB1>0){ h_dPhiJetMETBarrel_MB1Veto[itr_file]->Fill(dPhi_min); } if(nPassJetMuon>0){ h_dPhiJetMETBarrel_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ - h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); + if(nPassFull>0){ + h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); h_jetPtMET_fullVeto[itr_file]->Fill(jetPt_tmp); h_jetPtMax_fullVeto[itr_file]->Fill(jetPt[0]); } @@ -2319,7 +2300,7 @@ void analyzeSignal(){ h_nTotalClusteredRechitsBarrel_HOVeto[itr_file]->Fill(totalClusteredHO); h_nTotalClusteredRechitsBarrel_fullVeto[itr_file]->Fill(totalClusteredFull); h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - + h_dPhiClusterMETMax[itr_file]->Fill(dPhiClusterMET_max); h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); @@ -2365,8 +2346,8 @@ void analyzeSignal(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); jetPt_tmp = jetPt[itr_jet]; } goodJets+=1; @@ -2400,7 +2381,7 @@ void analyzeSignal(){ passInvertedMuon = false; passInvertedMuJet = false; llp_itr = -1; - + passNoVeto = true; if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } @@ -2409,13 +2390,13 @@ void analyzeSignal(){ dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } else{ passInvertedJet = true; } if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } else{ passInvertedMuon = true; } if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } @@ -2435,7 +2416,7 @@ void analyzeSignal(){ else if(rpcLayer[itr]==6){ matchLayer4+=1; } } } - + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } @@ -2469,7 +2450,7 @@ void analyzeSignal(){ muonDR_min=sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)); } } - + jetPt_max = 0.0; jetDR_min = 999.0; for(Int_t itr=0; itr<*nJets; itr++){ @@ -2485,17 +2466,17 @@ void analyzeSignal(){ jetDR_min=sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2)); } } - + if(dtRechitClusterSize[itr_clust]>50){ - + nPassNone+=1; totalClusteredNone+=dtRechitClusterSize[itr_clust]; if(passMuon){ nPassMuon+=1; } - if(passJet){ - nPassJet+=1; + if(passJet){ + nPassJet+=1; totalClusteredJet+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeMagnet_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); h_nRPCMatchedMagnet_jetVeto[itr_file]->Fill(match); @@ -2505,8 +2486,8 @@ void analyzeSignal(){ h_nRPCMatchedMagnetLayer3_jetVeto[itr_file]->Fill(matchLayer3); h_nRPCMatchedMagnetLayer4_jetVeto[itr_file]->Fill(matchLayer4); } - if(passMB1){ - nPassMB1+=1; + if(passMB1){ + nPassMB1+=1; totalClusteredMB1+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeMagnet_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } @@ -2525,27 +2506,27 @@ void analyzeSignal(){ if(passMuon && passHO){ h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); } - if(passJet && passMuon && passMB1){ - nPassFull+=1; + if(passJet && passMuon && passMB1){ + nPassFull+=1; totalClusteredFull+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeMagnet_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; + nPassHO+=1; + totalClusteredHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeMagnet_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - if(passJet && passMuon && passHO){ + if(passJet && passMuon && passHO){ passFullVeto = true; - nPassFullHO+=1; + nPassFullHO+=1; totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - + h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); @@ -2628,14 +2609,14 @@ void analyzeSignal(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); jetPt_tmp = jetPt[itr_jet]; } goodJets+=1; if(goodJets==4){ break; } } - } + } if(fabs(dPhi_min)>0.6){ //if(fabs(dPhiClusterMET_max)<1.0){ for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ @@ -2661,14 +2642,14 @@ void analyzeSignal(){ passInvertedMuon = false; passInvertedMuJet = false; llp_itr = -1; - + if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } else{ llp_itr = 1; } dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } else{ passInvertedJet = true; } if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } @@ -2688,20 +2669,20 @@ void analyzeSignal(){ if(sumE>40.){ passHO = true; } if(dtRechitClusterSize[itr_clust]>50){ - + nPassNone+=1; totalClusteredNone+=dtRechitClusterSize[itr_clust]; if(passMuon){ nPassMuon+=1; } - if(passJet){ + if(passJet){ nPassJet+=1; totalClusteredJet+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMB1){ - nPassMB1+=1; + if(passMB1){ + nPassMB1+=1; totalClusteredMB1+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } @@ -2710,17 +2691,17 @@ void analyzeSignal(){ totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - if(passJet && passMuon && passMB1){ - nPassFull+=1; + if(passJet && passMuon && passMB1){ + nPassFull+=1; totalClusteredFull+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - if(passHO){ + if(passHO){ nPassHO+=1; totalClusteredHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); } - if(passJet && passMuon && passHO){ + if(passJet && passMuon && passHO){ nPassFullHO+=1; totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; h_dtRechitClusterSizeAll_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); @@ -2745,7 +2726,7 @@ void analyzeSignal(){ }*/ evtNum+=1; } - + } //cout << "Total events = " << totalEvents << endl; //cout << "Total magnet events = " << totalMagnetEvents << endl; @@ -2763,7 +2744,7 @@ void analyzeSignal(){ cout << "nRPC Matched > 0: " << nPassRPCMatch * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "RPC Spread = 0: " << nPassRPCSpread * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "Max Station > 2: " << nPassMaxStation * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << " " << endl; //cout << "HO Decay: " << nPassHODecay * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; @@ -2771,7 +2752,7 @@ void analyzeSignal(){ cout << "Full Veto: " << nPassFullVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "nRPC Matched > 0: " << nPassRPCMatch_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "RPC Spread = 0: " << nPassRPCSpread_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; + cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << "DT cluster: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; cout << " " << endl; cout << "Muon veto: " << nPassMuon_std * 137.0 * 1000. * 48.58 * 0.01 << endl; @@ -2795,10 +2776,10 @@ void analyzeSignal(){ cout << " " << endl; - itr_file+=1; + itr_file+=1; } _ofile->Write(); _ofile->Close(); - + } diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 170d630..4e7d904 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -1,36 +1,6 @@ R__LOAD_LIBRARY(libTreePlayer) -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} - -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } - } - else{ - return -1*getWheel(-1.0*hitZ); - } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} +#include "helpers.h" void analyzeSignal_ABCD(){ @@ -121,7 +91,7 @@ void analyzeSignal_ABCD(){ Bool_t passMuon_alt = false; Bool_t passMB1 = false; Bool_t passJet = false; - + Bool_t passClusterCR = false; Bool_t passNoVeto_clusterCR = false; Bool_t passFullVeto_clusterCR = false; @@ -129,8 +99,8 @@ void analyzeSignal_ABCD(){ Bool_t passRPCSpread_clusterCR = false; Bool_t passRPCBx_clusterCR = false; Bool_t passMaxStation_clusterCR = false; - - Bool_t passNoVeto = false; + + Bool_t passNoVeto = false; Bool_t passFullVeto_rpcCR = false; Bool_t passRPCCR = false; Bool_t passClusterMET_rpcCR = false; @@ -144,8 +114,8 @@ void analyzeSignal_ABCD(){ Int_t nPassRPCSpread_clusterCR = 0; Int_t nPassRPCBx_clusterCR = 0; Int_t nPassMaxStation_clusterCR = 0; - - Int_t nPassNoVeto = 0; + + Int_t nPassNoVeto = 0; Int_t nPassFullVeto_rpcCR = 0; Int_t nPassRPCCR = 0; Int_t nPassClusterMET_rpcCR = 0; @@ -226,7 +196,7 @@ void analyzeSignal_ABCD(){ sprintf(name,"h_dtRechitClusterMaxStation_Nminus1_clusterMETCR_%s_%s",mX[itr_mX],ctau); h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_mX] = new TH1D(name,"",5,0,5); - + sprintf(name,"h_dPhiClusterMET_fullVeto_rpcCR_%s_%s",mX[itr_mX],ctau); h_dPhiClusterMET_fullVeto_rpcCR[itr_mX] = new TH1D(name,"",35,0,3.5); @@ -363,8 +333,8 @@ void analyzeSignal_ABCD(){ nPassRPCSpread_clusterCR = 0; nPassRPCBx_clusterCR = 0; nPassMaxStation_clusterCR = 0; - - nPassNoVeto = 0; + + nPassNoVeto = 0; nPassFullVeto_rpcCR = 0; nPassRPCCR = 0; nPassClusterMET_rpcCR = 0; @@ -377,7 +347,7 @@ void analyzeSignal_ABCD(){ cout << mX[itr_mX] << "_" << ctau << endl; for(Int_t itr_year = 0; itr_year<3; itr_year++){ cout << " " << years[itr_year] << endl; - + TFile *_file; if(strcmp(years[itr_year],"MC_Summer16")==0){ _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); @@ -385,15 +355,15 @@ void analyzeSignal_ABCD(){ else{ _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); } - + TTreeReader treeReader("MuonSystem",_file); - + TTreeReaderValue runNum(treeReader,"runNum"); TTreeReaderValue lumiSec(treeReader,"lumiSec"); TTreeReaderValue eventNum(treeReader,"evtNum"); TTreeReaderValue MET(treeReader,"met"); TTreeReaderValue METphi(treeReader,"metPhi"); - + TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); @@ -416,7 +386,7 @@ void analyzeSignal_ABCD(){ TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - + TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); @@ -425,7 +395,7 @@ void analyzeSignal_ABCD(){ TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - + TTreeReaderValue nJets(treeReader,"nJets"); TTreeReaderArray jetPt(treeReader,"jetPt"); TTreeReaderArray jetEta(treeReader,"jetEta"); @@ -437,16 +407,16 @@ void analyzeSignal_ABCD(){ TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); TTreeReaderArray jetMuonEnergyFraction(treeReader,"jetMuonEnergyFraction"); - + TTreeReaderValue nRPCRechits(treeReader,"nRpc"); TTreeReaderArray RPCRechitX(treeReader,"rpcX"); TTreeReaderArray RPCRechitY(treeReader,"rpcY"); TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); - + TTreeReaderValue nLeptons(treeReader,"nLeptons"); - + _ofile->cd(); totalNum += treeReader.GetEntries(1); while(treeReader.Next()){ @@ -461,7 +431,7 @@ void analyzeSignal_ABCD(){ passClusterMET_rpcCR = false; passMaxStation_rpcCR = false; maxClusterSize=0; - + if(*MET > 200){ dPhi_min = 999.; dPhiClusterMET = 0.0; @@ -480,16 +450,16 @@ void analyzeSignal_ABCD(){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); } } } } if(fabs(dPhiClusterMET)<1.0){ nPassClusterCR+=1; } - + for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ - if(dtRechitClusterSize[itr_clust]>50){ + if(dtRechitClusterSize[itr_clust]>50){ passMuon=false; passMuon_alt=false; passJet=false; @@ -504,11 +474,11 @@ void analyzeSignal_ABCD(){ dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } if(*nLeptons==0){ passMuon_alt = true; } - + passMB1 = true; for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ @@ -522,7 +492,7 @@ void analyzeSignal_ABCD(){ } } if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } - + //cout << "doing rpc" << endl; for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; @@ -541,7 +511,7 @@ void analyzeSignal_ABCD(){ } if(passJet && passMB1){ - + if(fabs(dPhiClusterMET)<1.0 && passMuon){ passFullVeto_clusterCR=true; h_nRPCMatched_fullVeto_clusterMETCR[itr_mX]->Fill(rpcBx.size()); @@ -549,7 +519,7 @@ void analyzeSignal_ABCD(){ h_rpcBx_fullVeto_clusterMETCR[itr_mX]->Fill(rpcMedian); h_dPhiJetMET_fullVeto_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); - + if(dtRechitClusterMaxStation[itr_clust]>2){ passMaxStation_clusterCR=true; if(!rpcBx.empty()){ @@ -562,7 +532,7 @@ void analyzeSignal_ABCD(){ } } } - + if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); } if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dPhiJetMET_Nminus1_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); } if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_mX]->Fill(rpcMedian); } @@ -575,20 +545,20 @@ void analyzeSignal_ABCD(){ h_dPhiClusterMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); h_dPhiJetMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); h_dtRechitClusterMaxStation_fullVeto_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); - + if(dtRechitClusterMaxStation[itr_clust]>2){ passMaxStation_rpcCR=true; h_dPhiClusterMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); h_dPhiJetMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); - if(fabs(dPhiClusterMET)<1.0){ + if(fabs(dPhiClusterMET)<1.0){ passClusterMET_rpcCR=true; } } if(fabs(dPhiClusterMET)<1.0){ - h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); + h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); } } - + if(passMuon){ if(!rpcBx.empty() && rpcSpread==0){ if(rpcMedian>=0.){ @@ -612,12 +582,12 @@ void analyzeSignal_ABCD(){ if(passRPCSpread_clusterCR){ nPassRPCSpread_clusterCR+=1; } if(passRPCBx_clusterCR){ nPassRPCBx_clusterCR+=1; } if(passMaxStation_clusterCR){ nPassMaxStation_clusterCR+=1; } - + if(passRPCCR){ nPassRPCCR+=1; } if(passFullVeto_rpcCR){ nPassFullVeto_rpcCR+=1; } if(passClusterMET_rpcCR){ nPassClusterMET_rpcCR+=1; } if(passMaxStation_rpcCR){ nPassMaxStation_rpcCR+=1; } - evtNum+=1; + evtNum+=1; } } @@ -641,7 +611,3 @@ void analyzeSignal_ABCD(){ _ofile->Close(); } - - - - diff --git a/helpers.h b/helpers.h new file mode 100644 index 0000000..e406ed5 --- /dev/null +++ b/helpers.h @@ -0,0 +1,31 @@ +int getStation(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 400. && hitR < 480.){ return 1; } + else if(hitR > 485. && hitR < 560.){ return 2; } + else if(hitR > 590. && hitR < 650.){ return 3; } + else if(hitR > 690. && hitR < 800.){ return 4; } + else{ return -1; } +} + +int getWheel(float hitZ){ + if(hitZ > 0){ + if(hitZ < 127.){ return 0; } + else if(hitZ < 395.){ return 1; } + else if(hitZ < 661.){ return 2; } + else{ return -99; } + } + else{ + return -1*getWheel(-1.0*hitZ); + } +} + +int getRPCLayer(float hitX, float hitY){ + float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); + if(hitR > 410. && hitR < 440.){ return 1; } + else if(hitR > 445. && hitR < 475.){ return 2; } + else if(hitR > 490. && hitR < 520.){ return 3; } + else if(hitR > 525. && hitR < 555.){ return 4; } + else if(hitR > 600. && hitR < 630.){ return 5; } + else if(hitR > 700. && hitR < 770.){ return 6; } + else{ return -1; } +} From 26d1591097787ab804c7760c1a9918b73ff4146a Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 14:01:28 -0500 Subject: [PATCH 05/15] use helpers --- analyzeData_DT.C | 63 ++++++++++++++++---------------------------- analyzeSignal_ABCD.C | 13 ++++++++- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/analyzeData_DT.C b/analyzeData_DT.C index 78a6608..b04f63e 100644 --- a/analyzeData_DT.C +++ b/analyzeData_DT.C @@ -1,45 +1,26 @@ R__LOAD_LIBRARY(libTreePlayer) -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} +#include "helpers.h" + +void analyzeData_beamHalo(){ -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; } - else{ - return -1*getWheel(-1.0*hitZ); + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} - -void analyzeData_beamHalo(){ char name[50]; char title[100]; char years[4][10] = {"2018","2017","2016"}; char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; - TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); TFile *_ofile = TFile::Open("outData_beamHalo.root","RECREATE"); TH2D *h_jetRechitT_jetEta[4]; @@ -64,7 +45,7 @@ void analyzeData_beamHalo(){ TH1D *h_nRpcRechits_Layer2[4]; TH1D *h_nRpcRechits_Layer3[4]; TH1D *h_nRpcRechits_Layer4[4]; - TH1D *h_nRpcRechits_Layer5[4]; + TH1D *h_nRpcRechits_Layer5[4]; TH1D *h_nRpcRechits_Layer6[4]; TH1D *h_nStation[4]; TH1D *h_nStationLowThresh[4]; @@ -94,7 +75,7 @@ void analyzeData_beamHalo(){ Int_t nStation = -1; Int_t nStationLowThresh = -1; Int_t nStationThresh = -1; - + Double_t dPhi_tmp = 0.0; Double_t dPhi_min = 0.0; Double_t dPhiClusterMET = 0.0; @@ -209,7 +190,7 @@ void analyzeData_beamHalo(){ sprintf(name,"h_rpcRechitX_rpcRechitY_%s",years[itr_year]); h_rpcRechitX_rpcRechitY[itr_year] = new TH2D(name,"",320,-800,800,320,-800,800); - + sprintf(name,"h_dtRechitZ_dtRechitR_%s",years[itr_year]); h_dtRechitZ_dtRechitR[itr_year] = new TH2D(name,"",240,-600,600,80,400,800); @@ -234,7 +215,7 @@ void analyzeData_beamHalo(){ } TTreeReader treeReader("MuonSystem",_file); - + TTreeReaderValue runNum(treeReader,"runNum"); TTreeReaderValue lumiSec(treeReader,"lumiSec"); TTreeReaderValue eventNum(treeReader,"evtNum"); @@ -312,16 +293,16 @@ void analyzeData_beamHalo(){ nPassFullPlus = 0; dPhi_min = 999.; if(evtNum%100000==0){ cout << evtNum << " of " << treeReader.GetEntries(1) << endl; } - + if(*MET > 200){ - + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ dPhi_tmp = jetPhi[itr_jet] - *METphi; if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); } } } @@ -403,7 +384,7 @@ void analyzeData_beamHalo(){ } } } - + h_nRpcRechits_Layer1[itr_year]->Fill(rpcLayerCount[0]); h_nRpcRechits_Layer2[itr_year]->Fill(rpcLayerCount[1]); h_nRpcRechits_Layer3[itr_year]->Fill(rpcLayerCount[2]); @@ -446,7 +427,7 @@ void analyzeData_beamHalo(){ if(passJet && passMuon && passMB1){ nPassFull += 1; - + if(!rpcBx.empty()){ if(rpcSpread==0){ if(dtRechitClusterMaxStation[itr_clust]>2){ diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 4e7d904..cd09e72 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -4,12 +4,23 @@ R__LOAD_LIBRARY(libTreePlayer) void analyzeSignal_ABCD(){ + const bool useHDFS(false); + const bool useCERN(false); + TString fsPreFix; + if (useHDFS) { + fsPreFix = "/mnt/hadoop"; + } + else { + fsPreFix = "root://cmsxrootd.fnal.gov/"; + if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; + } + char name[50]; char title[100]; char mX[3][10] = {"15","40","55"}; char ctau[10] = "10000"; char years[3][20] = {"MC_Summer16","MC_Fall17","MC_Fall18"}; - TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); + TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); TFile *_ofile = TFile::Open("outSig_ABCD.root","RECREATE"); TH1D *h_dtRechitClusterSize_signalRegion[4]; From 556264165ee62b5ab12e9ca39373dc991c3e9cc7 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 14:51:51 -0500 Subject: [PATCH 06/15] organize data files --- analyzeData.C | 6 +++++- datafiles.h | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 datafiles.h diff --git a/analyzeData.C b/analyzeData.C index f042336..8959ced 100644 --- a/analyzeData.C +++ b/analyzeData.C @@ -1,9 +1,11 @@ R__LOAD_LIBRARY(libTreePlayer) +#include "datafiles.h" #include "helpers.h" void analyzeData(){ + const bool useHDFS(false); const bool useCERN(false); TString fsPreFix; @@ -1267,7 +1269,9 @@ void analyzeData(){ _file = TFile::Open(dir+years[itr_year]+"/v4/v4/normalized/Run2_displacedJetMuonNtupler_V1p15_Data2016_Data2017_Data2018-HighMET_goodLumi.root"); } else{ - _file = TFile::Open(dir+years[itr_year]+"/v5/normalized/Run2_displacedJetMuonNtupler_V1p15_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); + // cout << itr_year << " " << datafiles[itr_year] << std::endl; + _file = TFile::Open(TString(datafiles[itr_year])); +// dir+years[itr_year]+"/v5/normalized/Run2_displacedJetMuonNtupler_V1p15_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); } TTreeReader treeReader("MuonSystem",_file); diff --git a/datafiles.h b/datafiles.h new file mode 100644 index 0000000..e0e8afb --- /dev/null +++ b/datafiles.h @@ -0,0 +1,22 @@ +#include +#include +#include + +#include "TH1D.h" +#include "TFile.h" +#include "TH2D.h" +#include "TFile.h" + +#include "TMath.h" +#include "TTreeReaderValue.h" +#include "TTreeReaderArray.h" +#include "TTreeReader.h" +#include +#include +#include "TString.h" + +std::vector datafiles = { + "Run2_displacedJetMuonNtupler_V1p17_Data2018_17Sept2018_Run2018-HighMET-17Sep2018_goodLumi.root", + "Run2_displacedJetMuonNtupler_V1p17_Data2017_Run2017-HighMET-17Nov2017_goodLumi.root", + "Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root" +}; From 2c0165786ab5220e8ef50717c65914d841164204 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 15:17:23 -0500 Subject: [PATCH 07/15] fix data files --- analyzeData_ABCD.C | 584 +++++++++++++++++++++++---------------------- 1 file changed, 293 insertions(+), 291 deletions(-) diff --git a/analyzeData_ABCD.C b/analyzeData_ABCD.C index 82bb57b..6ad0fd8 100644 --- a/analyzeData_ABCD.C +++ b/analyzeData_ABCD.C @@ -1,6 +1,7 @@ R__LOAD_LIBRARY(libTreePlayer) #include "helpers.h" +#include "datafiles.h" void analyzeData_ABCD(){ @@ -511,7 +512,8 @@ void analyzeData_ABCD(){ _file = TFile::Open(dir+years[itr_year]+"/v4/v4/normalized/Run2_displacedJetMuonNtupler_V1p15_Data2016_Data2017_Data2018-HighMET_goodLumi.root"); } else{ - _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); + _file = TFile::Open(TString(datafiles[itr_year])); + // _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); //_file = TFile::Open(dir+"Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); } @@ -598,284 +600,284 @@ void analyzeData_ABCD(){ maxClusterSize=0; if(*MET > 200){ - dPhi_min = 999.; - dPhiClusterMET = 0.0; - dPhiClusterMET_max = 0.0; - if(*nDtRechitClusters>0){ - nPassNoVeto+=1; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - if(dtRechitClusterSize[itr_clust]>maxClusterSize){ maxClusterSize = dtRechitClusterSize[itr_clust]; } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - } - } - } - } - if(fabs(dPhiClusterMET)>1.0){ nPassClusterCR+=1; } - - for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ - - if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - passMuon=false; - passMuon_alt=false; - passJet=false; - rpcBx.clear(); - rpcSpread = 99; - rpcMedian = 99; - dPhiClusterRPC = -0.1; - dZClusterRPC = -1.; - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - if(*nLeptons==0){ passMuon_alt = true; } - - passMB1 = true; - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ - passMB1 = false; - break; - } - } - } - if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } - - //cout << "doing rpc" << endl; - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp)0){ passRPCCR=true; } - - if(passMB1 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhi_min)<0.6){ - if(!passJet){ - h_rpcSpread_invertedJetVeto[itr_year]->Fill(rpcSpread); - if(passMuon){ - h_rpcSpread_invertedJetVeto_muonVeto[itr_year]->Fill(rpcSpread); - } - } - else{ - if(passMuon){ - h_rpcSpread_fullVeto[itr_year]->Fill(rpcSpread); - if(rpcMedian<0){ - h_rpcSpread_fullVeto_negBx[itr_year]->Fill(rpcSpread); - } - } - } - } - - if(passJet && passMB1){ - - if(passMuon){ - h_dPhiClusterRPC_fullVeto[itr_year]->Fill(dPhiClusterRPC); - h_dZClusterRPC_fullVeto[itr_year]->Fill(dZClusterRPC); - } - - //cout << "doing CRs" << endl; - if(fabs(dPhi_min)<0.6 && dtRechitClusterMaxStation[itr_clust]>2){ - if(!rpcBx.empty() && rpcSpread==0){ - if(fabs(dPhiClusterMET)<1.0){ - if(passMuon){ - h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passMuon_alt){ - h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - } - } - else{ - if(passMuon){ h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - else{ - if(fabs(dPhiClusterMET)<1.0){ - if(passMuon){ h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ h_dtRechitClusterSize_rpcNoMatch_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - } - - - if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ - if(!rpcBx.empty() && rpcSpread==0){ - if(fabs(dPhi_min)>0.6){ - if(passMuon){ - h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(event100_clusterMET<4 && dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150){ - eventListClusterMET << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - event100_clusterMET+=1; - } - else if(event150_clusterMET<4 && dtRechitClusterSize[itr_clust]>150){ - eventListClusterMET << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - event150_clusterMET+=1; - } - } - if(passMuon_alt){ - h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_rpcMatch_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - } - } - else{ - if(passMuon){ h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - else{ - if(fabs(dPhi_min)>0.6){ - if(passMuon){ h_dtRechitClusterSize_rpcBad_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ h_dtRechitClusterSize_rpcNoMatch_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - } - - - if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhi_min)>0.6){ - if(passMuon){ - if(!rpcBx.empty()){ - h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(rpcSpread==0){ - h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(rpcMedian<0.0){ - h_dtRechitClusterSize_rpcNegativeNoSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - } - } - else{ - h_dtRechitClusterSize_rpcSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(rpcMedian<0.0){ - h_dtRechitClusterSize_rpcNegativeSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - } - } - } - else{ h_dtRechitClusterSize_rpcNoMatch_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - } - - - if(fabs(dPhiClusterMET)>1.0 && passMuon){ - passFullVeto_clusterCR=true; - h_nRPCMatched_fullVeto_clusterMETCR[itr_year]->Fill(rpcBx.size()); - h_rpcSpread_fullVeto_clusterMETCR[itr_year]->Fill(rpcSpread); - h_rpcBx_fullVeto_clusterMETCR[itr_year]->Fill(rpcMedian); - h_dPhiJetMET_fullVeto_clusterMETCR[itr_year]->Fill(fabs(dPhi_min)); - h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); - - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation_clusterCR=true; - if(!rpcBx.empty()){ - passRPCMatch_clusterCR=true; - if(rpcSpread==0){ - passRPCSpread_clusterCR=true; - if(rpcMedian>=0.){ - passRPCBx_clusterCR=true; - } - } - } - } - - if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); } - if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dPhiJetMET_Nminus1_clusterMETCR[itr_year]->Fill(fabs(dPhi_min)); } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_year]->Fill(rpcMedian); } - if(!rpcBx.empty() && rpcMedian>=0. && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcSpread_Nminus1_clusterMETCR[itr_year]->Fill(rpcSpread); } - if(dtRechitClusterMaxStation[itr_clust]>2){ h_nRPCMatched_Nminus1_clusterMETCR[itr_year]->Fill(rpcBx.size()); } - } - - //cout << "doing rpc CRs" << endl; - if((rpcBx.empty() || rpcSpread>0) && dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhi_min)>0.6){ - if(passMuon){ - h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(fabs(dPhiClusterMET<1.0)){ - h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150 && event100_rpc<5){ - eventListRPC << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - event100_rpc+=1; - } - else if(dtRechitClusterSize[itr_clust]>150 && event150_rpc<5){ - eventListRPC << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - event150_rpc+=1; - } - } - else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - if(passMuon_alt){ - h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); - if(fabs(dPhiClusterMET<1.0)){ h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - else{ - if(passMuon){ h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETLow_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - - //cout << "rpc Spread CR" << endl; - if(rpcSpread>0 && rpcSpread<99 && dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhi_min)>0.6){ - if(passMuon){ - if(fabs(dPhiClusterMET<1.0)){ h_dtRechitClusterSize_dPhiClusterMETLow_rpcSpreadCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } - } - } - } - - - if((rpcBx.empty() || rpcSpread>0) && passMuon){ - passFullVeto_rpcCR=true; - h_dPhiClusterMET_fullVeto_rpcCR[itr_year]->Fill(fabs(dPhiClusterMET)); - h_dPhiJetMET_fullVeto_rpcCR[itr_year]->Fill(fabs(dPhi_min)); - h_dtRechitClusterMaxStation_fullVeto_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); - - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation_rpcCR=true; - h_dPhiClusterMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhiClusterMET)); - h_dPhiJetMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhi_min)); - if(fabs(dPhiClusterMET)<1.0){ - passClusterMET_rpcCR=true; - } - } - if(fabs(dPhiClusterMET)<1.0){ - h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); - } - } - - - } - } - } + dPhi_min = 999.; + dPhiClusterMET = 0.0; + dPhiClusterMET_max = 0.0; + if(*nDtRechitClusters>0){ + nPassNoVeto+=1; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + if(dtRechitClusterSize[itr_clust]>maxClusterSize){ maxClusterSize = dtRechitClusterSize[itr_clust]; } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + } + } + } + } + if(fabs(dPhiClusterMET)>1.0){ nPassClusterCR+=1; } + + for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ + + if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ + passMuon=false; + passMuon_alt=false; + passJet=false; + rpcBx.clear(); + rpcSpread = 99; + rpcMedian = 99; + dPhiClusterRPC = -0.1; + dZClusterRPC = -1.; + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + if(*nLeptons==0){ passMuon_alt = true; } + + passMB1 = true; + for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ + if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ + dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ + passMB1 = false; + break; + } + } + } + if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } + + //cout << "doing rpc" << endl; + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp)0){ passRPCCR=true; } + + if(passMB1 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhi_min)<0.6){ + if(!passJet){ + h_rpcSpread_invertedJetVeto[itr_year]->Fill(rpcSpread); + if(passMuon){ + h_rpcSpread_invertedJetVeto_muonVeto[itr_year]->Fill(rpcSpread); + } + } + else{ + if(passMuon){ + h_rpcSpread_fullVeto[itr_year]->Fill(rpcSpread); + if(rpcMedian<0){ + h_rpcSpread_fullVeto_negBx[itr_year]->Fill(rpcSpread); + } + } + } + } + + if(passJet && passMB1){ + + if(passMuon){ + h_dPhiClusterRPC_fullVeto[itr_year]->Fill(dPhiClusterRPC); + h_dZClusterRPC_fullVeto[itr_year]->Fill(dZClusterRPC); + } + + //cout << "doing CRs" << endl; + if(fabs(dPhi_min)<0.6 && dtRechitClusterMaxStation[itr_clust]>2){ + if(!rpcBx.empty() && rpcSpread==0){ + if(fabs(dPhiClusterMET)<1.0){ + if(passMuon){ + h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + } + if(passMuon_alt){ + h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + } + } + else{ + if(passMuon){ h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + if(passMuon_alt){ h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + else{ + if(fabs(dPhiClusterMET)<1.0){ + if(passMuon){ h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + if(passMuon_alt){ h_dtRechitClusterSize_rpcNoMatch_jetMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + } + + + if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ + if(!rpcBx.empty() && rpcSpread==0){ + if(fabs(dPhi_min)>0.6){ + if(passMuon){ + h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(event100_clusterMET<4 && dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150){ + eventListClusterMET << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; + event100_clusterMET+=1; + } + else if(event150_clusterMET<4 && dtRechitClusterSize[itr_clust]>150){ + eventListClusterMET << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; + event150_clusterMET+=1; + } + } + if(passMuon_alt){ + h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_rpcMatch_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + } + } + else{ + if(passMuon){ h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + else{ + if(fabs(dPhi_min)>0.6){ + if(passMuon){ h_dtRechitClusterSize_rpcBad_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + if(passMuon_alt){ h_dtRechitClusterSize_rpcNoMatch_clusterMETCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + } + + + if(fabs(dPhiClusterMET)>1.0 && dtRechitClusterMaxStation[itr_clust]>2){ + if(fabs(dPhi_min)>0.6){ + if(passMuon){ + if(!rpcBx.empty()){ + h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(rpcSpread==0){ + h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(rpcMedian<0.0){ + h_dtRechitClusterSize_rpcNegativeNoSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + } + } + else{ + h_dtRechitClusterSize_rpcSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(rpcMedian<0.0){ + h_dtRechitClusterSize_rpcNegativeSpread_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + } + } + } + else{ h_dtRechitClusterSize_rpcNoMatch_clusterMETCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + } + + + if(fabs(dPhiClusterMET)>1.0 && passMuon){ + passFullVeto_clusterCR=true; + h_nRPCMatched_fullVeto_clusterMETCR[itr_year]->Fill(rpcBx.size()); + h_rpcSpread_fullVeto_clusterMETCR[itr_year]->Fill(rpcSpread); + h_rpcBx_fullVeto_clusterMETCR[itr_year]->Fill(rpcMedian); + h_dPhiJetMET_fullVeto_clusterMETCR[itr_year]->Fill(fabs(dPhi_min)); + h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); + + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation_clusterCR=true; + if(!rpcBx.empty()){ + passRPCMatch_clusterCR=true; + if(rpcSpread==0){ + passRPCSpread_clusterCR=true; + if(rpcMedian>=0.){ + passRPCBx_clusterCR=true; + } + } + } + } + + if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); } + if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dPhiJetMET_Nminus1_clusterMETCR[itr_year]->Fill(fabs(dPhi_min)); } + if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_year]->Fill(rpcMedian); } + if(!rpcBx.empty() && rpcMedian>=0. && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcSpread_Nminus1_clusterMETCR[itr_year]->Fill(rpcSpread); } + if(dtRechitClusterMaxStation[itr_clust]>2){ h_nRPCMatched_Nminus1_clusterMETCR[itr_year]->Fill(rpcBx.size()); } + } + + //cout << "doing rpc CRs" << endl; + if((rpcBx.empty() || rpcSpread>0) && dtRechitClusterMaxStation[itr_clust]>2){ + if(fabs(dPhi_min)>0.6){ + if(passMuon){ + h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(fabs(dPhiClusterMET<1.0)){ + h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(dtRechitClusterSize[itr_clust]>100 && dtRechitClusterSize[itr_clust]<150 && event100_rpc<5){ + eventListRPC << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; + event100_rpc+=1; + } + else if(dtRechitClusterSize[itr_clust]>150 && event150_rpc<5){ + eventListRPC << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; + event150_rpc+=1; + } + } + else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + if(passMuon_alt){ + h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); + if(fabs(dPhiClusterMET<1.0)){ h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + else{ + if(passMuon){ h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + if(passMuon_alt){ h_dtRechitClusterSize_dPhiJetMETLow_rpcCRnoLepton[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + + //cout << "rpc Spread CR" << endl; + if(rpcSpread>0 && rpcSpread<99 && dtRechitClusterMaxStation[itr_clust]>2){ + if(fabs(dPhi_min)>0.6){ + if(passMuon){ + if(fabs(dPhiClusterMET<1.0)){ h_dtRechitClusterSize_dPhiClusterMETLow_rpcSpreadCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + else{ h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto[itr_year]->Fill(dtRechitClusterSize[itr_clust]); } + } + } + } + + + if((rpcBx.empty() || rpcSpread>0) && passMuon){ + passFullVeto_rpcCR=true; + h_dPhiClusterMET_fullVeto_rpcCR[itr_year]->Fill(fabs(dPhiClusterMET)); + h_dPhiJetMET_fullVeto_rpcCR[itr_year]->Fill(fabs(dPhi_min)); + h_dtRechitClusterMaxStation_fullVeto_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); + + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation_rpcCR=true; + h_dPhiClusterMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhiClusterMET)); + h_dPhiJetMET_Nminus1_rpcCR[itr_year]->Fill(fabs(dPhi_min)); + if(fabs(dPhiClusterMET)<1.0){ + passClusterMET_rpcCR=true; + } + } + if(fabs(dPhiClusterMET)<1.0){ + h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_year]->Fill(dtRechitClusterMaxStation[itr_clust]); + } + } + + + } + } + } } if(passFullVeto_clusterCR){ nPassFullVeto_clusterCR+=1; } if(passRPCMatch_clusterCR){ nPassRPCMatch_clusterCR+=1; } @@ -892,18 +894,18 @@ void analyzeData_ABCD(){ } /*cout << "nPassNoVeto: " << nPassNoVeto << endl; - cout << " " << endl; - cout << "nPassClusterCR: " << nPassClusterCR << endl; - cout << "nPassFullVeto_clusterCR: " << nPassFullVeto_clusterCR << endl; - cout << "nPassMaxStation_clusterCR: " << nPassMaxStation_clusterCR << endl; - cout << "nPassRPCMatch_clusterCR: " << nPassRPCMatch_clusterCR << endl; - cout << "nPassRPCSpread_clusterCR: " << nPassRPCSpread_clusterCR << endl; - cout << "nPassRPCBx_clusterCR: " << nPassRPCBx_clusterCR << endl; - cout << " " << endl; - cout << "nPassRPCCR: " << nPassRPCCR << endl; - cout << "nPassFullVeto_rpcCR: " << nPassFullVeto_rpcCR << endl; - cout << "nPassMaxStation_rpcCR: " << nPassMaxStation_rpcCR << endl; - cout << "nPassClusterMET_rpcCR: " << nPassClusterMET_rpcCR << endl; + cout << " " << endl; + cout << "nPassClusterCR: " << nPassClusterCR << endl; + cout << "nPassFullVeto_clusterCR: " << nPassFullVeto_clusterCR << endl; + cout << "nPassMaxStation_clusterCR: " << nPassMaxStation_clusterCR << endl; + cout << "nPassRPCMatch_clusterCR: " << nPassRPCMatch_clusterCR << endl; + cout << "nPassRPCSpread_clusterCR: " << nPassRPCSpread_clusterCR << endl; + cout << "nPassRPCBx_clusterCR: " << nPassRPCBx_clusterCR << endl; + cout << " " << endl; + cout << "nPassRPCCR: " << nPassRPCCR << endl; + cout << "nPassFullVeto_rpcCR: " << nPassFullVeto_rpcCR << endl; + cout << "nPassMaxStation_rpcCR: " << nPassMaxStation_rpcCR << endl; + cout << "nPassClusterMET_rpcCR: " << nPassClusterMET_rpcCR << endl; */ _ofile->Write(); _ofile->Close(); From 504d56b4d794dee4a770e68a9b1663b80e7998f0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 16:16:12 -0500 Subject: [PATCH 08/15] update signal files --- analyzeSignal_ABCD.C | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 6ee67fa..2937c25 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -1,6 +1,20 @@ R__LOAD_LIBRARY(libTreePlayer) #include "helpers.h" +#include +#include +#include + +#include "TH1D.h" +#include "TFile.h" +#include "TH2D.h" +#include "TFile.h" + +#include "TMath.h" +#include "TTreeReaderValue.h" +#include "TTreeReaderArray.h" +#include "TTreeReader.h" +#include "TString.h" void analyzeSignal_ABCD(){ @@ -391,12 +405,10 @@ void analyzeSignal_ABCD(){ TFile *_file; if(strcmp(years[itr_year],"MC_Summer16")==0){ - //_file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); } else{ - //_file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); } TTreeReader treeReader("MuonSystem",_file); From 9e0a684cb769961e144118637488fa16d7f25ffe Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 16:16:41 -0500 Subject: [PATCH 09/15] Delete old files --- analyzeData.C | 2344 ------------------------------------- analyzeData_DT.C | 457 -------- analyzeSignal.C | 2785 -------------------------------------------- analyzeSignal_SD.C | 2309 ------------------------------------ 4 files changed, 7895 deletions(-) delete mode 100644 analyzeData.C delete mode 100644 analyzeData_DT.C delete mode 100644 analyzeSignal.C delete mode 100644 analyzeSignal_SD.C diff --git a/analyzeData.C b/analyzeData.C deleted file mode 100644 index 8959ced..0000000 --- a/analyzeData.C +++ /dev/null @@ -1,2344 +0,0 @@ -R__LOAD_LIBRARY(libTreePlayer) - -#include "datafiles.h" -#include "helpers.h" - -void analyzeData(){ - - - const bool useHDFS(false); - const bool useCERN(false); - TString fsPreFix; - if (useHDFS) { - fsPreFix = "/mnt/hadoop"; - } - else { - fsPreFix = "root://cmsxrootd.fnal.gov/"; - if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; - } - - char name[50]; - char title[100]; - char years[4][10] = {"2018","2017","2016"}; - char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; - char dates[3][20] = {"17Sep2018","17Nov2017_v2","07Aug17"}; - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/Data"); - TFile *_ofile = TFile::Open("outData_altTest4.root","RECREATE"); - - TH1D *h_dPhiJetMET[4]; - TH1D *h_dPhiJetMET_noVeto[4]; - TH1D *h_dPhiJetMET_jetVeto[4]; - TH1D *h_dPhiJetMET_muonVeto[4]; - TH1D *h_dPhiJetMET_MB1Veto[4]; - TH1D *h_dPhiJetMET_noMB1Veto[4]; - TH1D *h_dPhiJetMET_fullVeto[4]; - TH1D *h_dPhiJetMET_fullHOVeto[4]; - TH1D *h_jetMet_dPhiMin4[4]; - TH1D *h_MET[4]; - TH1D *h_jetPt[4]; - - TH1D *h_nDtRechitClusters_noVeto[4]; - TH1D *h_dtRechitClusterSize_noVeto[4]; - TH1D *h_nTotalClusteredRechits_noVeto[4]; - TH1D *h_dtRechitClusterMaxStation_noVeto[4]; - TH1D *h_dtRechitClusterNStation_noVeto[4]; - TH1D *h_dPhiClusterMET_noVeto[4]; - TH1D *h_dtRechitClusterXSpread_noVeto[4]; - TH1D *h_dtRechitClusterYSpread_noVeto[4]; - TH1D *h_dtRechitClusterZSpread_noVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_noVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_noVeto[4]; - TH1D *h_nRPCMatched_noVeto[4]; - TH1D *h_RPCMatchedBx_noVeto[4]; - TH1D *h_RPCMatchedBxSpread_noVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_noVeto[4]; - TH1D *h_nRPCMatched_Spread0_noVeto[4]; - - TH1D *h_nDtRechitClusters_muonVeto[4]; - TH1D *h_dtRechitClusterSize_muonVeto[4]; - TH1D *h_nTotalClusteredRechits_muonVeto[4]; - TH1D *h_dtRechitClusterMaxStation_muonVeto[4]; - TH1D *h_dtRechitClusterNStation_muonVeto[4]; - TH1D *h_dPhiClusterMET_muonVeto[4]; - TH1D *h_dtRechitClusterXSpread_muonVeto[4]; - TH1D *h_dtRechitClusterYSpread_muonVeto[4]; - TH1D *h_dtRechitClusterZSpread_muonVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_muonVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_muonVeto[4]; - TH1D *h_nRPCMatched_muonVeto[4]; - TH1D *h_RPCMatchedBx_muonVeto[4]; - TH1D *h_RPCMatchedBxSpread_muonVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; - TH1D *h_nRPCMatched_Spread0_muonVeto[4]; - - TH1D *h_nDtRechitClusters_jetVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; - TH1D *h_dtRechitClusterSizeAll_jetVeto[4]; - TH1D *h_dtRechitClusterSize_jetVeto[4]; - TH1D *h_nTotalClusteredRechits_jetVeto[4]; - TH1D *h_dtRechitClusterMaxStation_jetVeto[4]; - TH1D *h_dtRechitClusterNStation_jetVeto[4]; - TH1D *h_dPhiClusterMET_jetVeto[4]; - TH1D *h_dtRechitClusterXSpread_jetVeto[4]; - TH1D *h_dtRechitClusterYSpread_jetVeto[4]; - TH1D *h_dtRechitClusterZSpread_jetVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_jetVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_jetVeto[4]; - TH1D *h_nRPCMatched_jetVeto[4]; - TH1D *h_nRPCMatchedLayer1_jetVeto[4]; - TH1D *h_nRPCMatchedLayer2_jetVeto[4]; - TH1D *h_nRPCMatchedLayer3_jetVeto[4]; - TH1D *h_nRPCMatchedLayer4_jetVeto[4]; - TH1D *h_nRPCMatchedLayer1_fullHOVeto[4]; - TH1D *h_nRPCMatchedLayer2_fullHOVeto[4]; - TH1D *h_nRPCMatchedLayer3_fullHOVeto[4]; - TH1D *h_nRPCMatchedLayer4_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_jetVeto[4]; - TH1D *h_RPCMatchedBxSpread_jetVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_jetVeto[4]; - TH1D *h_nRPCMatched_Spread0_jetVeto[4]; - - TH1D *h_nDtRechitClusters_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeBarrel_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeMagnet_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeAll_MB1Veto[4]; - TH1D *h_dtRechitClusterSize_MB1Veto[4]; - TH1D *h_nTotalClusteredRechits_MB1Veto[4]; - TH1D *h_nTotalClusteredRechits_noMB1Veto[4]; - TH1D *h_dtRechitClusterMaxStation_MB1Veto[4]; - TH1D *h_dtRechitClusterNStation_MB1Veto[4]; - TH1D *h_dPhiClusterMET_MB1Veto[4]; - TH1D *h_dtRechitClusterXSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterYSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterZSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterEtaSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterPhiSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_MB1Veto[4]; - TH1D *h_RPCMatchedBx_MB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_Spread0_MB1Veto[4]; - TH1D *h_RPCMatchedBx_Spread0_MB1Veto[4]; - - TH1D *h_nDtRechitClusters_fullVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_fullVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_fullVeto[4]; - TH1D *h_dtRechitClusterSizeAll_fullVeto[4]; - TH1D *h_dtRechitClusterSize_fullVeto[4]; - TH1D *h_nTotalClusteredRechits_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullHOVeto[4]; - TH1D *h_dtRechitClusterNStation_fullVeto[4]; - TH1D *h_dtRechitClusterNStationUnclustered_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshStation_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshStationUnclustered_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshLowStation_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullHOVeto[4]; - TH1D *h_dtRechitClusterXSpread_fullVeto[4]; - TH1D *h_dtRechitClusterYSpread_fullVeto[4]; - TH1D *h_dtRechitClusterZSpread_fullVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVeto[4]; - TH1D *h_nRPCMatched_fullVeto[4]; - TH1D *h_nRPCMatched_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullHOVeto[4]; - TH1D *h_nRPCMatched_Spread0_fullVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_fullVeto[4]; - - TH1D *h_dtRechitClusterEta_fullVeto[4]; - TH1D *h_dtRechitClusterPhi_fullVeto[4]; - TH1D *h_dtRechitClusterR_fullVeto[4]; - TH1D *h_dtRechitClusterZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZFine_fullVeto[4]; - TH2D *h_dtRechitClusterEtaPhi_fullVeto[4]; - TH2D *h_dtRechitClusterEtaPhiFine_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels50_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels25_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels1_fullVeto[4]; - TH1D *h_dtRechitClusterMaxWheel_fullVeto[4]; - TH2D *h_npv_nDtRechitClusters_fullVeto[4]; - TH2D *h_npv_nDtRechitClusters_noVeto[4]; - - TH1D *h_nHOMatched_fullVeto[4]; - TH1D *h_HOMatchedEnergy_fullVeto[4]; - TH1D *h_HOMatchedTime_fullVeto[4]; - TH2D *h_HOMatchedTime_RPCMatchedBx_fullVeto[4]; - TH1D *h_nHOMatched_invertedJetVeto[4]; - TH1D *h_HOMatchedEnergy_invertedJetVeto[4]; - TH1D *h_HOMatchedTime_invertedJetVeto[4]; - TH2D *h_HOMatchedTime_RPCMatchedBx_invertedJetVeto[4]; - TH1D *h_nHOMatched_noMB1Veto[4]; - TH1D *h_HOMatchedEnergy_noMB1Veto[4]; - TH1D *h_HOMatchedEnergyCluster280_noMB1Veto[4]; - TH1D *h_HOMatchedTime_noMB1Veto[4]; - TH2D *h_HOMatchedTime_RPCMatchedBx_noMB1Veto[4]; - TH1D *h_nHOMatched_invertedJet_noMB1Veto[4]; - TH1D *h_HOMatchedEnergy_invertedJet_noMB1Veto[4]; - TH1D *h_HOMatchedTime_invertedJet_noMB1Veto[4]; - TH2D *h_HOMatchedTime_RPCMatchedBx_invertedJet_noMB1Veto[4]; - - TH1D *h_RPCMatchedBx_invertedJetVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuonVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuJetVeto[4]; - - TH1D *h_dtRechitClusterSize_noMB1Veto[4]; - TH1D *h_dtRechitClusterNStation_noMB1Veto[4]; - TH1D *h_dtRechitClusterNRechitsMB1_noMB1Veto[4]; - TH1D *h_dtRechitClusterPercentRechitsMB1_noMB1Veto[4]; - TH1D *h_nRPCMatched_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer1_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer2_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer12_noMB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_noMB1Veto[4]; - - TH1D *h_dtRechitClusterSize_HOVeto[4]; - TH1D *h_nTotalClusteredRechits_HOVeto[4]; - TH1D *h_nTotalClusteredRechits_fullHOVeto[4]; - TH1D *h_nTotalClusteredRechits_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterSize_fullHOVeto[4]; - TH1D *h_dtRechitClusterSize_RPCMatch[4]; - TH1D *h_dtRechitClusterSize_RPCSpread0[4]; - - TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; - TH1D *h_dtRechitClusterXSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterYSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterZSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEta_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhi_fullVetoPlus[4]; - TH2D *h_dtRechitClusterEtaPhi_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNWheel_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoMinus[4]; - - TH1D *h_dtRechitClusterEta_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterPhi_fullHOVetoPlus[4]; - TH2D *h_dtRechitClusterEtaPhi_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterNWheel_fullHOVetoPlus[4]; - - TH1D *h_HOTime_fullHOVeto[4]; - - TH1D *h_muonPt_jetMB1Veto[4]; - TH1D *h_jetPt_muonMB1Veto[4]; - TH1D *h_MB1Rechits_jetMuonVeto[4]; - TH1D *h_muonPt_jetHOVeto[4]; - TH1D *h_jetPt_muonHOVeto[4]; - TH1D *h_HOEnergy_jetMuonVeto[4]; - - TH1D *h_HOEnergy_jetVeto[4]; - - TH1D *h_muonDR_fullVeto[4]; - TH1D *h_muonDR_RPCMatch[4]; - TH1D *h_muonDR_RPCSpread0[4]; - TH1D *h_jetDR_fullVeto[4]; - TH1D *h_jetDR_RPCMatch[4]; - TH1D *h_jetDR_RPCSpread0[4]; - TH1D *h_muonDR_fullHOVeto[4]; - TH1D *h_muonDR_HORPCMatch[4]; - TH1D *h_muonDR_HORPCSpread0[4]; - TH1D *h_jetDR_fullHOVeto[4]; - TH1D *h_jetDR_HORPCMatch[4]; - TH1D *h_jetDR_HORPCSpread0[4]; - TH1D *h_jetDR_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPt_minDR_fullHOVetoPlus[4]; - TH1D *h_jetEta_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPhi_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetMuonEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetDR_minDR_fullHOVetoMinus[4]; - TH1D *h_jetPt_minDR_fullHOVetoMinus[4]; - TH1D *h_jetEta_minDR_fullHOVetoMinus[4]; - TH1D *h_jetPhi_minDR_fullHOVetoMinus[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoMinus[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoMinus[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoMinus[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoMinus[4]; - TH1D *h_jetMuonEnergyFraction_minDR_fullHOVetoMinus[4]; - TH1D *h_jetDR_minDR_vetoJet[4]; - TH1D *h_jetPt_minDR_vetoJet[4]; - TH1D *h_jetEta_minDR_vetoJet[4]; - TH1D *h_jetPhi_minDR_vetoJet[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetMuonEnergyFraction_minDR_vetoJet[4]; - - TH1D *h_dPhiJetMET_noRPCMatch_nRechitsLow[4]; - TH1D *h_dPhiJetMET_noRPCMatch_nRechitsHigh[4]; - TH1D *h_dtRechitClusterSize_noRPCMatch_dPhiLow[4]; - TH1D *h_dtRechitClusterSize_noRPCMatch_dPhiHigh[4]; - - TH1D *h_nWheels1_noCluster[4]; - TH1D *h_nWheels10_noCluster[4]; - TH1D *h_nWheels20_noCluster[4]; - TH1D *h_nWheels30_noCluster[4]; - TH1D *h_nWheels50_noCluster[4]; - TH1D *h_nWheels150_noCluster[4]; - TH1D *h_nWheels1_noVeto[4]; - TH1D *h_nWheels1_fullVetoPlus[4]; - TH1D *h_nWheels1_fullVetoMinus[4]; - TH1D *h_nWheels10_noVeto[4]; - TH1D *h_nWheels10_fullVetoPlus[4]; - TH1D *h_nWheels10_fullVetoMinus[4]; - TH1D *h_nWheels20_noVeto[4]; - TH1D *h_nWheels20_fullVetoPlus[4]; - TH1D *h_nWheels20_fullVetoMinus[4]; - TH1D *h_nWheels30_noVeto[4]; - TH1D *h_nWheels30_fullVetoPlus[4]; - TH1D *h_nWheels30_fullVetoMinus[4]; - TH1D *h_nWheels50_noVeto[4]; - TH1D *h_nWheels50_fullVetoPlus[4]; - TH1D *h_nWheels50_fullVetoMinus[4]; - TH1D *h_nWheels150_noVeto[4]; - TH1D *h_nWheels150_fullVetoPlus[4]; - TH1D *h_nWheels150_fullVetoMinus[4]; - - TH1D *h_jetPtMax_noVeto[4]; - TH1D *h_jetPtMax_fullVeto[4]; - TH1D *h_jetPtMax_fullVetoPlus[4]; - TH1D *h_jetPtMax_fullVetoMinus[4]; - TH1D *h_jetPtMET_noVeto[4]; - TH1D *h_jetPtMET_fullVeto[4]; - TH1D *h_jetPtMET_fullVetoPlus[4]; - TH1D *h_jetPtMET_fullVetoMinus[4]; - - TH1D *h_jetPtMET_noVeto_rpcCR[4]; - TH1D *h_jetPtMET_fullVeto_rpcCR[4]; - TH1D *h_jetPtMET_fullVetoPlus_rpcCR[4]; - TH1D *h_dtRechitClusterPhiStation2_fullVeto_rpcCR[4]; - TH1D *h_dtRechitClusterPhiStation3_fullVeto_rpcCR[4]; - TH1D *h_dtRechitClusterPhiStation4_fullVeto_rpcCR[4]; - - TH1D *h_runNum_phi = new TH1D("h_runNum_phi","",80,270e3,350e3); - TH1D *h_runNum_eta = new TH1D("h_runNum_eta","",80,270e3,350e3); - TH1D *h_runNum_etaphi = new TH1D("h_runNum_etaphi","",80,270e3,350e3); - TH1D *h_badRun_lumiSec = new TH1D("h_badRun_lumiSec","",3500,0,3500); - TH1D *h_badRun_dtRechitClusterSize = new TH1D("h_badRun_dtRechitClusterSize","",100,0,1000); - TH1D *h_badRun_dtRechitClusterNStation = new TH1D("h_badRun_dtRechitClusterNStation","",5,0,5); - TH1D *h_badRun_dtRechitClusterXSpread = new TH1D("h_badRun_dtRechitClusterXSpread","",40,0,400); - TH1D *h_badRun_dtRechitClusterYSpread = new TH1D("h_badRun_dtRechitClusterYSpread","",40,0,400); - TH1D *h_badRun_dtRechitClusterPhiSpread = new TH1D("h_badRun_dtRechitClusterPhiSpread","",40,0,2); - TH1D *h_badRun_dtRechitClusterNWheel = new TH1D("h_badRun_dtRechitClusterNWheel","",40,0,2); - - Int_t rechitCount[5]; - Int_t stationCount[4]; - Int_t rechitWheel = -99; - Int_t rechitStation = -99; - Int_t hitWheels1 = -1; - Int_t hitWheels10 = -1; - Int_t hitWheels20 = -1; - Int_t hitWheels30 = -1; - Int_t hitWheels50 = -1; - Int_t hitWheels150 = -1; - Int_t nStationUnclustered = -1; - Int_t nThreshStation = -1; - Int_t nThreshLowStation = -1; - Int_t nThreshStationUnclustered = -1; - Int_t nThreshLowStationUnclustered = -1; - - Double_t dPhi_tmp = 0.0; - Double_t dPhiClusterMET = 0.0; - Double_t dPhiClusterMET_max = -1.0; - Double_t dPhi_min = 999.; - Double_t dPhi_minTop4 = 999.; - Double_t dPhi_min20 = 999.; - Double_t dPhi_min30 = 999.; - Double_t dPhi_min50 = 999.; - Double_t clustSizeMax = 0.; - Double_t dPhi_clust = 999.; - Double_t jetPt_tmp = 0.0; - Double_t jetPt_max = 0.0; - Double_t jetDR_min = 0.0; - Double_t muonPt_max = 0.0; - Double_t muonDR_min = 0.0; - Int_t jetDR_index = -1; - Int_t muonDR_index = -1; - - vector muStatus = {}; - Double_t dR_tmp = 0.0; - Int_t nMatched = 0; - vector goodStatus = {1,44,51,52,91}; - vector rpcBx = {}; - vector rpcLayer = {}; - Int_t rpcSpread = 0; - Float_t rpcMedian = 0; - - Int_t evtNum = 0; - Bool_t goodEvt = false; - Int_t itr_file = 0; - Int_t goodJets = 0; - Bool_t matchJet = false; - Bool_t matchMuon = false; - Int_t match = 0; - Int_t matchLayer1 = 0; - Int_t matchLayer2 = 0; - Int_t matchLayer3 = 0; - Int_t matchLayer4 = 0; - Int_t matchHO = 0; - Float_t sumE = 0; - Float_t weightT = 0; - Float_t totalSumE = 0; - - Bool_t passMuon = false; - Bool_t passJet = false; - Bool_t passMB1 = false; - Bool_t passMB1_alt = false; - Bool_t passMuon_alt = false; - Bool_t passHO = false; - Bool_t passInvertedJet = false; - Bool_t passInvertedMuon = false; - Bool_t passInvertedMuJet = false; - Int_t nPassMuon = 0; - Int_t nPassMuon_std = 0; - Int_t nPassMB1_std = 0; - Int_t nPassMuon_alt = 0; - Int_t nPassMB1_alt = 0; - Int_t nPassJet = 0; - Int_t nPassJetMuon = 0; - Int_t nPassMB1 = 0; - Int_t nPassHO = 0; - Int_t nPassJetMuon_std = 0; - Int_t nPassJetMB1_std = 0; - Int_t nPassFull = 0; - Int_t nPassFull_std = 0; - Int_t nPassFull_altMuon = 0; - Int_t nPassFull_altMB1 = 0; - Int_t nPassFull_altMuonMB1 = 0; - Int_t nPassFullPlus = 0; - Int_t nPassFullPlus_rpcCR = 0; - Int_t nPassFullMinus = 0; - Int_t nPassFullDT = 0; - Int_t nPassFullDTPlus_noMuon = 0; - Int_t nPassFullDTPlus_noMB1 = 0; - Int_t nPassFullDTPlus_std = 0; - Int_t nPassFullDTPlus_altMuon = 0; - Int_t nPassFullDTPlus_altMB1 = 0; - Int_t nPassFullDTPlus_altMuonMB1 = 0; - Int_t nPassFullHO = 0; - Int_t nPassNone = 0; - Int_t totalClusteredNone = 0; - Int_t totalClusteredJet = 0; - Int_t totalClusteredMB1 = 0; - Int_t totalClusteredNoMB1 = 0; - Int_t totalClusteredHO = 0; - Int_t totalClusteredFull = 0; - Int_t totalClusteredFullHO = 0; - - Int_t totalClusteredFullPlus = 0; - Int_t totalClusteredFullHOPlus = 0; - - Int_t nPassMET = 0; - Int_t nPassDecayDT = 0; - Int_t nPassDecayHO = 0; - Bool_t failJetMET = false; - Bool_t failJetMET_20 = false; - Bool_t failJetMET_30 = false; - Bool_t failJetMET_50 = false; - Bool_t failJetMET_top4 = false; - Int_t nPassJetMET = 0; - Int_t nFailJetMET = 0; - Int_t nFailJetMET_top4 = 0; - Int_t nFailJetMET_20 = 0; - Int_t nFailJetMET_30 = 0; - Int_t nFailJetMET_50 = 0; - Int_t nPassCluster = 0; - Int_t nPassMaxStation_dt = 0; - Int_t nPassDeltaPhi_dt = 0; - Int_t nPassRPCMatch_dt = 0; - Int_t nPassRPCSpread_dt = 0; - Int_t nPassDeltaPhi_ho = 0; - Int_t nPassRPCMatch_ho = 0; - Int_t nPassRPCSpread_ho = 0; - - ofstream eventList; - eventList.open("events/fullHOVetoPlusEvents.txt"); - - for(Int_t itr_year=0; itr_year<3; itr_year++){ - sprintf(name,"h_jetMet_dPhiMin4_%s",years[itr_year]); - h_jetMet_dPhiMin4[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_%s",years[itr_year]); - h_dPhiJetMET[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_noVeto_%s",years[itr_year]); - h_dPhiJetMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_jetVeto_%s",years[itr_year]); - h_dPhiJetMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_muonVeto_%s",years[itr_year]); - h_dPhiJetMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_MB1Veto_%s",years[itr_year]); - h_dPhiJetMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_noMB1Veto_%s",years[itr_year]); - h_dPhiJetMET_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_fullVeto_%s",years[itr_year]); - h_dPhiJetMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_fullHOVeto_%s",years[itr_year]); - h_dPhiJetMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_MET_%s",years[itr_year]); - h_MET[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_jetPt_%s",years[itr_year]); - h_jetPt[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nDtRechitClusters_noVeto_%s",years[itr_year]); - h_nDtRechitClusters_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_noVeto_%s",years[itr_year]); - h_dtRechitClusterSize_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_noVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_noVeto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_noVeto_%s",years[itr_year]); - h_dtRechitClusterNStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_noVeto_%s",years[itr_year]); - h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s",years[itr_year]); - h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_noVeto_%s",years[itr_year]); - h_dtRechitClusterYSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_noVeto_%s",years[itr_year]); - h_dtRechitClusterZSpread_noVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_noVeto_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_noVeto_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_noVeto_%s",years[itr_year]); - h_RPCMatchedBx_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_noVeto_%s",years[itr_year]); - h_nRPCMatched_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noVeto_%s",years[itr_year]); - h_RPCMatchedBxSpread_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_noVeto_%s",years[itr_year]); - h_RPCMatchedBx_Spread0_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_noVeto_%s",years[itr_year]); - h_nRPCMatched_Spread0_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_muonVeto_%s",years[itr_year]); - h_nDtRechitClusters_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_muonVeto_%s",years[itr_year]); - h_dtRechitClusterSize_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_muonVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_muonVeto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_muonVeto_%s",years[itr_year]); - h_dtRechitClusterNStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_muonVeto_%s",years[itr_year]); - h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s",years[itr_year]); - h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_muonVeto_%s",years[itr_year]); - h_dtRechitClusterYSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_muonVeto_%s",years[itr_year]); - h_dtRechitClusterZSpread_muonVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_muonVeto_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_muonVeto_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_muonVeto_%s",years[itr_year]); - h_RPCMatchedBx_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_muonVeto_%s",years[itr_year]); - h_nRPCMatched_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_muonVeto_%s",years[itr_year]); - h_RPCMatchedBxSpread_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_muonVeto_%s",years[itr_year]); - h_RPCMatchedBx_Spread0_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_muonVeto_%s",years[itr_year]); - h_nRPCMatched_Spread0_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_jetVeto_%s",years[itr_year]); - h_nDtRechitClusters_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_jetVeto_%s",years[itr_year]); - h_dtRechitClusterSize_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_jetVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_jetVeto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_jetVeto_%s",years[itr_year]); - h_dtRechitClusterNStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_jetVeto_%s",years[itr_year]); - h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s",years[itr_year]); - h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_jetVeto_%s",years[itr_year]); - h_dtRechitClusterYSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_jetVeto_%s",years[itr_year]); - h_dtRechitClusterZSpread_jetVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_jetVeto_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_jetVeto_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_jetVeto_%s",years[itr_year]); - h_RPCMatchedBx_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_jetVeto_%s",years[itr_year]); - h_nRPCMatched_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer1_jetVeto_%s",years[itr_year]); - h_nRPCMatchedLayer1_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer2_jetVeto_%s",years[itr_year]); - h_nRPCMatchedLayer2_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer3_jetVeto_%s",years[itr_year]); - h_nRPCMatchedLayer3_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer4_jetVeto_%s",years[itr_year]); - h_nRPCMatchedLayer4_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer1_fullHOVeto_%s",years[itr_year]); - h_nRPCMatchedLayer1_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer2_fullHOVeto_%s",years[itr_year]); - h_nRPCMatchedLayer2_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer3_fullHOVeto_%s",years[itr_year]); - h_nRPCMatchedLayer3_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedLayer4_fullHOVeto_%s",years[itr_year]); - h_nRPCMatchedLayer4_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_RPCMatchedBxSpread_jetVeto_%s",years[itr_year]); - h_RPCMatchedBxSpread_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_jetVeto_%s",years[itr_year]); - h_RPCMatchedBx_Spread0_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_jetVeto_%s",years[itr_year]); - h_nRPCMatched_Spread0_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_MB1Veto_%s",years[itr_year]); - h_nDtRechitClusters_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterSize_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_MB1Veto_%s",years[itr_year]); - h_nTotalClusteredRechits_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_noMB1Veto_%s",years[itr_year]); - h_nTotalClusteredRechits_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterNStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_MB1Veto_%s",years[itr_year]); - h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterYSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterZSpread_MB1Veto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_MB1Veto_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_MB1Veto_%s",years[itr_year]); - h_RPCMatchedBx_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_MB1Veto_%s",years[itr_year]); - h_nRPCMatched_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_MB1Veto_%s",years[itr_year]); - h_RPCMatchedBxSpread_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_MB1Veto_%s",years[itr_year]); - h_RPCMatchedBx_Spread0_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_MB1Veto_%s",years[itr_year]); - h_nRPCMatched_Spread0_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_fullVeto_%s",years[itr_year]); - h_nDtRechitClusters_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_fullVeto_%s",years[itr_year]); - h_dtRechitClusterSize_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_fullVeto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterMaxStation_fullHOVeto_%s",years[itr_year]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStationUnclustered_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshStation_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNThreshStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshLowStation_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNThreshLowStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshStationUnclustered_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNThreshStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshLowStationUnclustered_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_fullVeto_%s",years[itr_year]); - h_dPhiClusterMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s",years[itr_year]); - h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s",years[itr_year]); - h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVeto_%s",years[itr_year]); - h_dtRechitClusterYSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVeto_%s",years[itr_year]); - h_dtRechitClusterZSpread_fullVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVeto_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVeto_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_fullVeto_%s",years[itr_year]); - h_RPCMatchedBx_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_fullVeto_%s",years[itr_year]); - h_nRPCMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatched_fullHOVeto_%s",years[itr_year]); - h_nRPCMatched_fullHOVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_fullVeto_%s",years[itr_year]); - h_RPCMatchedBxSpread_fullVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBxSpread_fullHOVeto_%s",years[itr_year]); - h_RPCMatchedBxSpread_fullHOVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBx_Spread0_fullVeto_%s",years[itr_year]); - h_RPCMatchedBx_Spread0_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_fullVeto_%s",years[itr_year]); - h_nRPCMatched_Spread0_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_dtRechitClusterEta_fullVeto_%s",years[itr_year]); - h_dtRechitClusterEta_fullVeto[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVeto_%s",years[itr_year]); - h_dtRechitClusterPhi_fullVeto[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterR_fullVeto_%s",years[itr_year]); - h_dtRechitClusterR_fullVeto[itr_file] = new TH1D(name,"",40,0,800); - - sprintf(name,"h_dtRechitClusterZ_fullVeto_%s",years[itr_year]); - h_dtRechitClusterZ_fullVeto[itr_file] = new TH1D(name,"",120,-600,600); - - sprintf(name,"h_dtRechitClusterRZ_fullVeto_%s",years[itr_year]); - h_dtRechitClusterRZ_fullVeto[itr_file] = new TH2D(name,"",120,-600,600,40,400,800); - - sprintf(name,"h_dtRechitClusterRZFine_fullVeto_%s",years[itr_year]); - h_dtRechitClusterRZFine_fullVeto[itr_file] = new TH2D(name,"",1200,-600,600,400,400,800); - - sprintf(name,"h_dtRechitClusterEtaPhi_fullVeto_%s",years[itr_year]); - h_dtRechitClusterEtaPhi_fullVeto[itr_file] = new TH2D(name,"",16,-2,2,70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterEtaPhiFine_fullVeto_%s",years[itr_year]); - h_dtRechitClusterEtaPhiFine_fullVeto[itr_file] = new TH2D(name,"",16,-2,2,140,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterNWheels50_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNWheels50_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels25_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNWheels25_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels1_fullVeto_%s",years[itr_year]); - h_dtRechitClusterNWheels1_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterMaxWheel_fullVeto_%s",years[itr_year]); - h_dtRechitClusterMaxWheel_fullVeto[itr_file] = new TH1D(name,"",6,-3,3); - - sprintf(name,"h_npv_nDtRechitClusters_fullVeto_%s",years[itr_year]); - h_npv_nDtRechitClusters_fullVeto[itr_file] = new TH2D(name,"",50,0,100,5,0,5); - - sprintf(name,"h_nHOMatched_fullVeto_%s",years[itr_year]); - h_nHOMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_HOMatchedEnergy_fullVeto_%s",years[itr_year]); - h_HOMatchedEnergy_fullVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOMatchedTime_fullVeto_%s",years[itr_year]); - h_HOMatchedTime_fullVeto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_HOMatchedTime_RPCMatchedBx_fullVeto_%s",years[itr_year]); - h_HOMatchedTime_RPCMatchedBx_fullVeto[itr_file] = new TH2D(name,"",60,-60,60,13,-6.5,6.5); - - sprintf(name,"h_nHOMatched_invertedJetVeto_%s",years[itr_year]); - h_nHOMatched_invertedJetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_HOMatchedEnergy_invertedJetVeto_%s",years[itr_year]); - h_HOMatchedEnergy_invertedJetVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOMatchedTime_invertedJetVeto_%s",years[itr_year]); - h_HOMatchedTime_invertedJetVeto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_HOMatchedTime_RPCMatchedBx_invertedJetVeto_%s",years[itr_year]); - h_HOMatchedTime_RPCMatchedBx_invertedJetVeto[itr_file] = new TH2D(name,"",60,-60,60,13,-6.5,6.5); - - sprintf(name,"h_nHOMatched_noMB1Veto_%s",years[itr_year]); - h_nHOMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_HOMatchedEnergy_noMB1Veto_%s",years[itr_year]); - h_HOMatchedEnergy_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOMatchedEnergyCluster280_noMB1Veto_%s",years[itr_year]); - h_HOMatchedEnergyCluster280_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOMatchedTime_noMB1Veto_%s",years[itr_year]); - h_HOMatchedTime_noMB1Veto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_HOMatchedTime_RPCMatchedBx_noMB1Veto_%s",years[itr_year]); - h_HOMatchedTime_RPCMatchedBx_noMB1Veto[itr_file] = new TH2D(name,"",60,-60,60,13,-6.5,6.5); - - sprintf(name,"h_nHOMatched_invertedJet_noMB1Veto_%s",years[itr_year]); - h_nHOMatched_invertedJet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_HOMatchedEnergy_invertedJet_noMB1Veto_%s",years[itr_year]); - h_HOMatchedEnergy_invertedJet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOMatchedTime_invertedJet_noMB1Veto_%s",years[itr_year]); - h_HOMatchedTime_invertedJet_noMB1Veto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_HOMatchedTime_RPCMatchedBx_invertedJet_noMB1Veto_%s",years[itr_year]); - h_HOMatchedTime_RPCMatchedBx_invertedJet_noMB1Veto[itr_file] = new TH2D(name,"",60,-60,60,13,-6.5,6.5); - - sprintf(name,"h_npv_nDtRechitClusters_noVeto_%s",years[itr_year]); - h_npv_nDtRechitClusters_noVeto[itr_file] = new TH2D(name,"",50,0,100,5,0,5); - - sprintf(name,"h_RPCMatchedBx_invertedJetVeto_%s",years[itr_year]); - h_RPCMatchedBx_invertedJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuonVeto_%s",years[itr_year]); - h_RPCMatchedBx_invertedMuonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s",years[itr_year]); - h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s",years[itr_year]); - h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterNStation_noMB1Veto_%s",years[itr_year]); - h_dtRechitClusterNStation_noMB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNRechitsMB1_noMB1Veto_%s",years[itr_year]); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterPercentRechitsMB1_noMB1Veto_%s",years[itr_year]); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_nRPCMatched_noMB1Veto_%s",years[itr_year]); - h_nRPCMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer1_noMB1Veto_%s",years[itr_year]); - h_nRPCMatchedLayer1_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer2_noMB1Veto_%s",years[itr_year]); - h_nRPCMatchedLayer2_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer12_noMB1Veto_%s",years[itr_year]); - h_nRPCMatchedLayer12_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noMB1Veto_%s",years[itr_year]); - h_RPCMatchedBxSpread_noMB1Veto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_dtRechitClusterSize_HOVeto_%s",years[itr_year]); - h_dtRechitClusterSize_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_fullHOVeto_%s",years[itr_year]); - h_dtRechitClusterSize_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_HOVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullHOVeto_%s",years[itr_year]); - h_nTotalClusteredRechits_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullVetoPlus_%s",years[itr_year]); - h_nTotalClusteredRechits_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullHOVetoPlus_%s",years[itr_year]); - h_nTotalClusteredRechits_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterEta_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterEta_fullVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterPhi_fullVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterEtaPhi_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); - - sprintf(name,"h_dtRechitClusterNStation_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterNStation_fullVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterNWheel_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNWheel_fullHOVetoPlus_%s",years[itr_year]); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoPlus_%s",years[itr_year]); - h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoMinus_%s",years[itr_year]); - h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_dtRechitClusterEta_fullHOVetoPlus_%s",years[itr_year]); - h_dtRechitClusterEta_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullHOVetoPlus_%s",years[itr_year]); - h_dtRechitClusterPhi_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterEtaPhi_fullHOVetoPlus_%s",years[itr_year]); - h_dtRechitClusterEtaPhi_fullHOVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); - - sprintf(name,"h_dtRechitClusterNStation_fullHOVetoPlus_%s",years[itr_year]); - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterSize_RPCMatch_%s",years[itr_year]); - h_dtRechitClusterSize_RPCMatch[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_RPCSpread0_%s",years[itr_year]); - h_dtRechitClusterSize_RPCSpread0[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_HOTime_fullHOVeto_%s",years[itr_year]); - h_HOTime_fullHOVeto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_muonPt_jetMB1Veto_%s",years[itr_year]); - h_muonPt_jetMB1Veto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonMB1Veto_%s",years[itr_year]); - h_jetPt_muonMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_MB1Rechits_jetMuonVeto_%s",years[itr_year]); - h_MB1Rechits_jetMuonVeto[itr_file] = new TH1D(name,"",200,0,200); - - sprintf(name,"h_muonPt_jetHOVeto_%s",years[itr_year]); - h_muonPt_jetHOVeto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonHOVeto_%s",years[itr_year]); - h_jetPt_muonHOVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOEnergy_jetMuonVeto_%s",years[itr_year]); - h_HOEnergy_jetMuonVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_HOEnergy_jetVeto_%s",years[itr_year]); - h_HOEnergy_jetVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_muonDR_fullVeto_%s",years[itr_year]); - h_muonDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCMatch_%s",years[itr_year]); - h_muonDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCSpread0_%s",years[itr_year]); - h_muonDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullVeto_%s",years[itr_year]); - h_jetDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCMatch_%s",years[itr_year]); - h_jetDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCSpread0_%s",years[itr_year]); - h_jetDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_fullHOVeto_%s",years[itr_year]); - h_muonDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCMatch_%s",years[itr_year]); - h_muonDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCSpread0_%s",years[itr_year]); - h_muonDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullHOVeto_%s",years[itr_year]); - h_jetDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCMatch_%s",years[itr_year]); - h_jetDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCSpread0_%s",years[itr_year]); - h_jetDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetDR_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetPt_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetEta_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetPhi_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetMuonEnergyFraction_minDR_fullHOVetoPlus_%s",years[itr_year]); - h_jetMuonEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetDR_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetDR_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetPt_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetEta_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetPhi_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFraction_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetChargedEMEnergyFraction_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFraction_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFraction_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetMuonEnergyFraction_minDR_fullHOVetoMinus_%s",years[itr_year]); - h_jetMuonEnergyFraction_minDR_fullHOVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetDR_minDR_vetoJet_%s",years[itr_year]); - h_jetDR_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_vetoJet_%s",years[itr_year]); - h_jetPt_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_vetoJet_%s",years[itr_year]); - h_jetEta_minDR_vetoJet[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_vetoJet_%s",years[itr_year]); - h_jetPhi_minDR_vetoJet[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFraction_minDR_vetoJet_%s",years[itr_year]); - h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFraction_minDR_vetoJet_%s",years[itr_year]); - h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFraction_minDR_vetoJet_%s",years[itr_year]); - h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFraction_minDR_vetoJet_%s",years[itr_year]); - h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetMuonEnergyFraction_minDR_vetoJet_%s",years[itr_year]); - h_jetMuonEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_dPhiJetMET_noRPCMatch_nRechitsLow_%s",years[itr_year]); - h_dPhiJetMET_noRPCMatch_nRechitsLow[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_noRPCMatch_nRechitsHigh_%s",years[itr_year]); - h_dPhiJetMET_noRPCMatch_nRechitsHigh[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterSize_noRPCMatch_dPhiLow_%s",years[itr_year]); - h_dtRechitClusterSize_noRPCMatch_dPhiLow[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_noRPCMatch_dPhiHigh_%s",years[itr_year]); - h_dtRechitClusterSize_noRPCMatch_dPhiHigh[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nWheels1_noCluster_%s",years[itr_year]); - h_nWheels1_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_noCluster_%s",years[itr_year]); - h_nWheels10_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_noCluster_%s",years[itr_year]); - h_nWheels20_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_noCluster_%s",years[itr_year]); - h_nWheels30_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_noCluster_%s",years[itr_year]); - h_nWheels50_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_noCluster_%s",years[itr_year]); - h_nWheels150_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_noVeto_%s",years[itr_year]); - h_nWheels1_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_fullVetoPlus_%s",years[itr_year]); - h_nWheels1_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_fullVetoMinus_%s",years[itr_year]); - h_nWheels1_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_noVeto_%s",years[itr_year]); - h_nWheels10_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_fullVetoPlus_%s",years[itr_year]); - h_nWheels10_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_fullVetoMinus_%s",years[itr_year]); - h_nWheels10_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_noVeto_%s",years[itr_year]); - h_nWheels20_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_fullVetoPlus_%s",years[itr_year]); - h_nWheels20_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_fullVetoMinus_%s",years[itr_year]); - h_nWheels20_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_noVeto_%s",years[itr_year]); - h_nWheels30_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_fullVetoPlus_%s",years[itr_year]); - h_nWheels30_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_fullVetoMinus_%s",years[itr_year]); - h_nWheels30_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_noVeto_%s",years[itr_year]); - h_nWheels50_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_fullVetoPlus_%s",years[itr_year]); - h_nWheels50_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_fullVetoMinus_%s",years[itr_year]); - h_nWheels50_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_noVeto_%s",years[itr_year]); - h_nWheels150_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_fullVetoPlus_%s",years[itr_year]); - h_nWheels150_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_fullVetoMinus_%s",years[itr_year]); - h_nWheels150_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_jetPtMax_noVeto_%s",years[itr_year]); - h_jetPtMax_noVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVeto_%s",years[itr_year]); - h_jetPtMax_fullVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVetoPlus_%s",years[itr_year]); - h_jetPtMax_fullVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVetoMinus_%s",years[itr_year]); - h_jetPtMax_fullVetoMinus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_noVeto_%s",years[itr_year]); - h_jetPtMET_noVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVeto_%s",years[itr_year]); - h_jetPtMET_fullVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVetoPlus_%s",years[itr_year]); - h_jetPtMET_fullVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVetoMinus_%s",years[itr_year]); - h_jetPtMET_fullVetoMinus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_noVeto_rpcCR_%s",years[itr_year]); - h_jetPtMET_noVeto_rpcCR[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVeto_rpcCR_%s",years[itr_year]); - h_jetPtMET_fullVeto_rpcCR[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVetoPlus_rpcCR_%s",years[itr_year]); - h_jetPtMET_fullVetoPlus_rpcCR[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_dtRechitClusterPhiStation2_fullVeto_rpcCR_%s",years[itr_year]); - h_dtRechitClusterPhiStation2_fullVeto_rpcCR[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterPhiStation3_fullVeto_rpcCR_%s",years[itr_year]); - h_dtRechitClusterPhiStation3_fullVeto_rpcCR[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterPhiStation4_fullVeto_rpcCR_%s",years[itr_year]); - h_dtRechitClusterPhiStation4_fullVeto_rpcCR[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - TFile *_file; - if(strcmp(years[itr_year],"All")==0){ - _file = TFile::Open(dir+years[itr_year]+"/v4/v4/normalized/Run2_displacedJetMuonNtupler_V1p15_Data2016_Data2017_Data2018-HighMET_goodLumi.root"); - } - else{ - // cout << itr_year << " " << datafiles[itr_year] << std::endl; - _file = TFile::Open(TString(datafiles[itr_year])); -// dir+years[itr_year]+"/v5/normalized/Run2_displacedJetMuonNtupler_V1p15_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); - } - - TTreeReader treeReader("MuonSystem",_file); - - TTreeReaderValue runNum(treeReader,"runNum"); - TTreeReaderValue lumiSec(treeReader,"lumiSec"); - TTreeReaderValue eventNum(treeReader,"evtNum"); - TTreeReaderValue npv(treeReader,"npv"); - TTreeReaderValue MET(treeReader,"met"); - TTreeReaderValue METphi(treeReader,"metPhi"); - TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); - - TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); - TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); - TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); - TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); - TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); - TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); - TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); - TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); - TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); - TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); - TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); - TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); - TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); - TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); - TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); - TTreeReaderArray dtRechitClusterNSegmentStation2(treeReader,"dtRechitClusterNSegmentStation2"); - TTreeReaderArray dtRechitClusterNSegmentStation3(treeReader,"dtRechitClusterNSegmentStation3"); - TTreeReaderArray dtRechitClusterNSegmentStation4(treeReader,"dtRechitClusterNSegmentStation4"); - TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); - TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); - TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); - TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - - TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); - TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); - TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); - TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); - TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); - TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); - TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); - TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - - TTreeReaderValue nJets(treeReader,"nJets"); - TTreeReaderArray jetPt(treeReader,"jetPt"); - TTreeReaderArray jetEta(treeReader,"jetEta"); - TTreeReaderArray jetPhi(treeReader,"jetPhi"); - TTreeReaderArray jetChargedEMEnergyFraction(treeReader,"jetChargedEMEnergyFraction"); - TTreeReaderArray jetNeutralEMEnergyFraction(treeReader,"jetNeutralEMEnergyFraction"); - TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); - TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); - //TTreeReaderArray jetMuonEnergyFraction(treeReader,"jetMuonEnergyFraction"); - - TTreeReaderValue nLeptons(treeReader,"nLeptons"); - TTreeReaderArray lepPassLooseIso(treeReader,"lepPassLooseIso"); - TTreeReaderValue nMuons(treeReader,"nMuons"); - TTreeReaderArray muonEta(treeReader,"muonEta"); - TTreeReaderArray muonPhi(treeReader,"muonPhi"); - TTreeReaderArray muonPt(treeReader,"muonPt"); - - TTreeReaderValue nRPCRechits(treeReader,"nRpc"); - TTreeReaderArray RPCRechitX(treeReader,"rpcX"); - TTreeReaderArray RPCRechitY(treeReader,"rpcY"); - TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); - TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); - TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); - - TTreeReaderValue nHORechits(treeReader,"nHORechits"); - TTreeReaderArray HORechitE(treeReader,"hoRechit_E"); - TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); - TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); - TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); - - _ofile->cd(); - evtNum = 0; - cout << "Data" << years[itr_year] << endl; - while(treeReader.Next()){ - fill_n(rechitCount, 5, 0); - hitWheels1 = 0; - hitWheels10 = 0; - hitWheels20 = 0; - hitWheels30 = 0; - hitWheels50 = 0; - hitWheels150 = 0; - goodEvt = false; - clustSizeMax = 0.; - failJetMET = false; - failJetMET_20 = false; - failJetMET_30 = false; - failJetMET_50 = false; - failJetMET_top4 = false; - dPhi_min = 999.; - dPhi_minTop4 = 999.; - dPhi_min20 = 999.; - dPhi_min30 = 999.; - dPhi_min50 = 999.; - jetPt_tmp = 0.0; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullPlus = 0; - nPassFullMinus = 0; - //nPassFullHO = 0; - nPassNone = 0; - totalSumE = 0.0; - totalClusteredNone = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredNoMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - totalClusteredFullPlus = 0; - totalClusteredFullHOPlus = 0; - if(evtNum%100000==0){ cout << evtNum << " of " << treeReader.GetEntries(1) << endl; } - - if(*MET > 200){ - nPassMET+=1; - h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - if(*nJets>0){ - goodJets=0; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - if(goodJets<4){ dPhi_minTop4 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>50.0){ dPhi_min50 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>30.0){ dPhi_min30 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>20.0){ dPhi_min20 = fabs(dPhi_tmp); } - } - goodJets+=1; - //if(goodJets==4){ break; } - } - } - } - if(fabs(dPhi_min)>0.6 && fabs(dPhi_min)<999.){ failJetMET += true; } - if(fabs(dPhi_minTop4)>0.6 && fabs(dPhi_minTop4)<999.){ failJetMET_top4 += true; } - if(fabs(dPhi_min50)>0.6 && fabs(dPhi_min50)<999.){ failJetMET_50 += true; } - if(fabs(dPhi_min30)>0.6 && fabs(dPhi_min30)<999.){ failJetMET_30 += true; } - if(fabs(dPhi_min20)>0.6 && fabs(dPhi_min20)<999.){ failJetMET_20 += true; } - - dPhi_min=dPhi_minTop4; - if(dPhi_min!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } - if(fabs(dPhi_min)<0.6){ - //if(fabs(dPhiClusterMET_max)>1.0){ - nPassJetMET+=1; - h_MET[itr_file]->Fill(*MET); - h_jetPt[itr_file]->Fill(jetPt_tmp); - //cout << "starting counting"; - //for(int i=0; i=0 && rechitWheel<5){ - rechitCount[rechitWheel] += 1; - } - } - } - else{ - fill_n(rechitCount, 5, 150); - } - //cout << "done counting"; - //for(int i=0; i 0){ hitWheels1 += 1; } - if(rechitCount[itr_wheel] > 9){ hitWheels10 += 1; } - if(rechitCount[itr_wheel] > 19){ hitWheels20 += 1; } - if(rechitCount[itr_wheel] > 29){ hitWheels30 += 1; } - if(rechitCount[itr_wheel] > 49){ hitWheels50 += 1; } - if(rechitCount[itr_wheel] > 149){ hitWheels150 += 1; } - } - h_nWheels1_noCluster[itr_file]->Fill(hitWheels1); - h_nWheels10_noCluster[itr_file]->Fill(hitWheels10); - h_nWheels20_noCluster[itr_file]->Fill(hitWheels20); - h_nWheels30_noCluster[itr_file]->Fill(hitWheels30); - h_nWheels50_noCluster[itr_file]->Fill(hitWheels50); - h_nWheels150_noCluster[itr_file]->Fill(hitWheels150); - - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - fill_n(stationCount, 4, 0); - nStationUnclustered = 0; - nThreshStation = 0; - nThreshLowStation = 0; - nThreshStationUnclustered = 0; - nThreshLowStationUnclustered = 0; - matchHO = 0; - sumE = 0.0; - weightT = 0.0; - rpcBx.clear(); - rpcLayer.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passMB1_alt = false; - passMuon_alt = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - /*passJet = true; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(jetPt[itr_jet]>20.){ - dPhi_tmp = RPCRechitPhi[itr_jet] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr_jet]-dtRechitClusterEta[itr_clust],2))<0.5){ - passJet = false; - break; - } - } - } - if(!passJet){ passInvertedJet = true; } - */ - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - passMB1_alt = true; - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ - passMB1_alt = false; - break; - } - } - } - passMuon_alt = true; - for(Int_t itr_lep = 0; itr_lep<*nLeptons; itr_lep++){ - if(lepPassLooseIso[itr_lep]){ - passMuon_alt = false; - break; - } - } - //if(*nLeptons==0){ passMuon_alt = true; } - - if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - - nPassNone+=1; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - if(!rpcLayer.empty()){ - for(Int_t itr = 0; itr12){ nThreshStation+=1; } - if(dtRechitClusterNSegmentStation3[itr_clust]>12){ nThreshStation+=1; } - if(dtRechitClusterNSegmentStation4[itr_clust]>8){ nThreshStation+=1; } - - if(dtRechitClusterNSegmentStation2[itr_clust]>4){ nThreshLowStation+=1; } - if(dtRechitClusterNSegmentStation3[itr_clust]>4){ nThreshLowStation+=1; } - if(dtRechitClusterNSegmentStation4[itr_clust]>2){ nThreshLowStation+=1; } - - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(passJet){ - h_HOEnergy_jetVeto[itr_file]->Fill(sumE); - } - if(sumE>40.){ passHO = true; } - - muonPt_max = 0.0; - muonDR_min = 999.0; - for(Int_t itr=0; itr<*nMuons; itr++){ - dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(muonPt[itr]>muonPt_max){ - muonPt_max=muonPt[itr]; - } - } - if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(jetPt[itr]>jetPt_max){ - jetPt_max=jetPt[itr]; - } - } - if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))Fill(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))); - h_jetPt_minDR_vetoJet[itr_file]->Fill(jetPt[itr]); - h_jetEta_minDR_vetoJet[itr_file]->Fill(jetEta[itr]); - h_jetPhi_minDR_vetoJet[itr_file]->Fill(jetPhi[itr]); - h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedEMEnergyFraction[itr]); - h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralEMEnergyFraction[itr]); - h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedHadronEnergyFraction[itr]); - h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralHadronEnergyFraction[itr]); - //h_jetMuonEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetMuonEnergyFraction[itr]); - } - } - - h_dtRechitClusterSize_noVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_noVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_noVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_noVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_noVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_noVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_noVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_noVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_noVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_noVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } - } - - if(passMuon){ - nPassMuon+=1; - h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_muonVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_muonVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_muonVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_muonVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_muonVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_muonVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_muonVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_muonVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_muonVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } - } - } - - if(passJet){ - nPassJet+=1; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_jetVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_jetVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_jetVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_jetVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_jetVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_jetVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_jetVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_jetVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_jetVeto[itr_file]->Fill(match); - - h_nRPCMatchedLayer1_jetVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedLayer2_jetVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedLayer3_jetVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedLayer4_jetVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } - } - } - - if(passMB1){ - nPassMB1+=1; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_MB1Veto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_MB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_MB1Veto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_MB1Veto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_MB1Veto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_MB1Veto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_MB1Veto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } - } - } - - /* if(!passMB1){ - if(!rpcBx.empty()){ - if(rpcBx.size()%2 == 0){ rpcMedian = float(rpcBx[rpcBx.size()/2 - 1] + rpcBx[rpcBx.size()/2]) / 2.0; } - else{ rpcMedian = rpcBx[rpcBx.size()/2]; } - } - h_nHOMatched_noMB1Veto[itr_file]->Fill(matchHO); - if(sumE>20.){ - h_HOMatchedEnergy_noMB1Veto[itr_file]->Fill(sumE); - h_HOMatchedTime_noMB1Veto[itr_file]->Fill(weightT/sumE); - if(!rpcBx.empty()){ - h_HOMatchedTime_RPCMatchedBx_noMB1Veto[itr_file]->Fill(weightT/sumE,rpcMedian); - } - } - }*/ - - if(passInvertedJet && !passMB1){ - if(!rpcBx.empty()){ - if(rpcBx.size()%2 == 0){ rpcMedian = float(rpcBx[rpcBx.size()/2 - 1] + rpcBx[rpcBx.size()/2]) / 2.0; } - else{ rpcMedian = rpcBx[rpcBx.size()/2]; } - } - h_nHOMatched_invertedJet_noMB1Veto[itr_file]->Fill(matchHO); - if(sumE>20.){ - h_HOMatchedEnergy_invertedJet_noMB1Veto[itr_file]->Fill(sumE); - h_HOMatchedTime_invertedJet_noMB1Veto[itr_file]->Fill(weightT/sumE); - if(!rpcBx.empty()){ - h_HOMatchedTime_RPCMatchedBx_invertedJet_noMB1Veto[itr_file]->Fill(weightT/sumE,rpcMedian); - } - } - } - - if(passInvertedJet && passMB1){ - if(!rpcBx.empty()){ - if(rpcBx.size()%2 == 0){ rpcMedian = float(rpcBx[rpcBx.size()/2 - 1] + rpcBx[rpcBx.size()/2]) / 2.0; } - else{ rpcMedian = rpcBx[rpcBx.size()/2]; } - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - h_nHOMatched_invertedJetVeto[itr_file]->Fill(matchHO); - if(sumE>20.){ - h_HOMatchedEnergy_invertedJetVeto[itr_file]->Fill(sumE); - h_HOMatchedTime_invertedJetVeto[itr_file]->Fill(weightT/sumE); - if(!rpcBx.empty()){ - h_HOMatchedTime_RPCMatchedBx_invertedJetVeto[itr_file]->Fill(weightT/sumE,rpcMedian); - } - } - } - - if(passInvertedMuon && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passInvertedMuon && passInvertedJet && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passMuon && passJet){ - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file]->Fill(float(dtRechitClusterNSegmentStation1[itr_clust]) / dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNStation_noMB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_MB1Rechits_jetMuonVeto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - h_HOEnergy_jetMuonVeto[itr_file]->Fill(sumE); - h_nRPCMatched_noMB1Veto[itr_file]->Fill(match); - if(!rpcLayer.empty()){ - h_RPCMatchedBxSpread_noMB1Veto[itr_file]->Fill(max_element(rpcBx.begin(),rpcBx.end()) - min_element(rpcBx.begin(),rpcBx.end())); - for(Int_t itr = 0; itrFill(matchLayer1); - h_nRPCMatchedLayer2_noMB1Veto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedLayer12_noMB1Veto[itr_file]->Fill(matchLayer1+matchLayer2); - if(dtRechitClusterSize[itr_clust]>=280){ - totalSumE+=sumE; - } - } - - if(passMuon && passJet && passMB1){ - nPassFull+=1; - - if(*nDtRechits<1000){ - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.5){ - rechitStation = getStation(dtRechitX[itr_dt],dtRechitY[itr_dt]); - if(rechitStation>-1){ - stationCount[rechitStation-1] += 1; - } - } - } - } - else{ - fill_n(stationCount, 4, 150); - } - for(Int_t itr_station=0; itr_station<4; itr_station++){ - if(stationCount[itr_station]>0){ nStationUnclustered+=1; } - if(itr_station<3){ - if(stationCount[itr_station]>12){ nThreshStationUnclustered+=1; } - if(stationCount[itr_station]>4){ nThreshLowStationUnclustered+=1; } - } - else{ - if(stationCount[itr_station]>8){ nThreshStationUnclustered+=1; } - if(stationCount[itr_station]>2){ nThreshLowStationUnclustered+=1; } - } - } - - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNThreshStation_fullVeto[itr_file]->Fill(nThreshStation); - - h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNStationUnclustered_fullVeto[itr_file]->Fill(nStationUnclustered); - h_dtRechitClusterNThreshStation_fullVeto[itr_file]->Fill(nThreshStation); - h_dtRechitClusterNThreshLowStation_fullVeto[itr_file]->Fill(nThreshLowStation); - h_dtRechitClusterNThreshStationUnclustered_fullVeto[itr_file]->Fill(nThreshStationUnclustered); - h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[itr_file]->Fill(nThreshLowStationUnclustered); - h_dPhiClusterMET_fullVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_fullVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_fullVeto[itr_file]->Fill(match); - - h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); - h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterEtaPhi_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust],dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterEtaPhiFine_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust],dtRechitClusterPhi[itr_clust]); - - if(dtRechitClusterPhi[itr_clust]>0.4 && dtRechitClusterPhi[itr_clust]<0.6){ - h_runNum_phi->Fill(*runNum); - if(dtRechitClusterEta[itr_clust]>0.5 && dtRechitClusterEta[itr_clust]<0.6){ - h_runNum_etaphi->Fill(*runNum); - } - if(*runNum>275.75e3&&*runNum<275.95e3){ - //eventList << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - h_badRun_lumiSec->Fill(*lumiSec); - h_badRun_dtRechitClusterSize->Fill(dtRechitClusterSize[itr_clust]); - h_badRun_dtRechitClusterNStation->Fill(dtRechitClusterNStation[itr_clust]); - h_badRun_dtRechitClusterNWheel->Fill(dtRechitClusterNChamber[itr_clust]); - h_badRun_dtRechitClusterXSpread->Fill(dtRechitClusterXSpread[itr_clust]); - h_badRun_dtRechitClusterYSpread->Fill(dtRechitClusterYSpread[itr_clust]); - h_badRun_dtRechitClusterPhiSpread->Fill(dtRechitClusterPhiSpread[itr_clust]); - } - } - if(dtRechitClusterEta[itr_file]>0.5 && dtRechitClusterEta[itr_file]<0.6){ - h_runNum_eta->Fill(*runNum); - } - - h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); - if(!rpcBx.empty()){ - if(rpcBx.size()%2 == 0){ rpcMedian = float(rpcBx[rpcBx.size()/2 - 1] + rpcBx[rpcBx.size()/2]) / 2.0; } - else{ rpcMedian = rpcBx[rpcBx.size()/2]; } - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } - } - - h_nHOMatched_fullVeto[itr_file]->Fill(matchHO); - if(sumE>20.){ - h_HOMatchedEnergy_fullVeto[itr_file]->Fill(sumE); - h_HOMatchedTime_fullVeto[itr_file]->Fill(weightT/sumE); - if(!rpcBx.empty()){ - h_HOMatchedTime_RPCMatchedBx_fullVeto[itr_file]->Fill(weightT/sumE,rpcMedian); - } - } - - h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); - - if(!rpcBx.empty()){ - nPassRPCMatch_dt+=1; - h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_RPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - nPassRPCSpread_dt+=1; - h_dtRechitClusterSize_RPCSpread0[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_RPCSpread0[itr_file]->Fill(jetDR_min); - if(dtRechitClusterMaxStation[itr_clust]>2){ - nPassMaxStation_dt+=1; - if(fabs(dPhiClusterMET)<1 && fabs(dPhi_min)<0.6){ - nPassFullPlus+=1; - nPassDeltaPhi_dt+=1; - totalClusteredFullPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterXSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); - //cout << "DT decay: jet DR = " << jetDR_min << ", muon DR = " << muonDR_min << endl; - //eventList << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - } - } - } - } - else{ - if(fabs(dPhi_min)<0.6){ - h_dtRechitClusterSize_noRPCMatch_dPhiLow[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - else{ - h_dtRechitClusterSize_noRPCMatch_dPhiHigh[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(dtRechitClusterSize[itr_clust]<100){ - h_dPhiJetMET_noRPCMatch_nRechitsLow[itr_file]->Fill(fabs(dPhi_min)); - } - else{ - h_dPhiJetMET_noRPCMatch_nRechitsHigh[itr_file]->Fill(fabs(dPhi_min)); - } - } - - if(dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhi_min)<0.6){ - if(fabs(dPhiClusterMET)<1 && (rpcBx.empty() || rpcSpread>0)){ - nPassFullMinus+=1; - h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); - h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); - } - } - - } - - if(passMuon && passJet){ - nPassJetMuon_std+=1; - if(passMB1_alt){ - nPassFull_altMB1+=1; - } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhiClusterMET)<1 && fabs(dPhi_min)<0.6){ - nPassFullDTPlus_noMB1+=1; - if(passMB1_alt){ - nPassFullDTPlus_altMB1+=1; - } - } - } - - if(passMB1 && passJet){ - nPassJetMB1_std+=1; - if(passMuon_alt){ - nPassFull_altMuon+=1; - } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhiClusterMET)<1 && fabs(dPhi_min)<0.6){ - nPassFullDTPlus_noMuon+=1; - if(passMuon_alt){ - nPassFullDTPlus_altMuon+=1; - } - } - } - - if(passMuon_alt){ - nPassMuon_alt+=1; - if(passJet && passMB1_alt){ - nPassFull_altMuonMB1+=1; - if(!rpcBx.empty()){ - if(rpcSpread==0){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhiClusterMET)<1 && fabs(dPhi_min)<0.6){ - nPassFullDTPlus_altMuonMB1+=1; - } - } - } - } - } - } - if(passMB1_alt){ - nPassMB1_alt+=1; - } - if(passMuon){ - nPassMuon_std+=1; - } - if(passMB1){ - nPassMB1_std+=1; - if(passJet && passMuon){ - nPassFull_std+=1; - if(!rpcBx.empty()){ - if(rpcSpread==0){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhiClusterMET)<1 && fabs(dPhi_min)<0.6){ - nPassFullDTPlus_std+=1; - } - } - } - } - } - } - - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passHO){ - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); - h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); - h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - - h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); - - h_nRPCMatchedLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - nPassRPCMatch_ho+=1; - h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - nPassRPCSpread_ho+=1; - h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); - if(fabs(dPhiClusterMET)<1){ - nPassDeltaPhi_ho+=1; - totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - //cout << "HO decay: jet DR = " << jetDR_min << ", muon DR = " << muonDR_min << endl; - //eventList << *runNum << ":" << *lumiSec << ":" << *eventNum << endl; - h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); - h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); - h_jetEta_minDR_fullHOVetoPlus[itr_file]->Fill(jetEta[jetDR_index]); - h_jetPhi_minDR_fullHOVetoPlus[itr_file]->Fill(jetPhi[jetDR_index]); - if(jetDR_min<0.6){ - h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); - //h_jetMuonEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetMuonEnergyFraction[jetDR_index]); - } - } - } - } - if((rpcBx.empty() || rpcSpread>0) && fabs(dPhiClusterMET)<1){ - h_dtRechitClusterEta_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterPhi_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterEtaPhi_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_jetDR_minDR_fullHOVetoMinus[itr_file]->Fill(jetDR_min); - h_jetPt_minDR_fullHOVetoMinus[itr_file]->Fill(jetPt[jetDR_index]); - h_jetEta_minDR_fullHOVetoMinus[itr_file]->Fill(jetEta[jetDR_index]); - h_jetPhi_minDR_fullHOVetoMinus[itr_file]->Fill(jetPhi[jetDR_index]); - if(jetDR_min<0.6){ - h_jetChargedEMEnergyFraction_minDR_fullHOVetoMinus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoMinus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoMinus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoMinus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); - //h_jetMuonEnergyFraction_minDR_fullHOVetoMinus[itr_file]->Fill(jetMuonEnergyFraction[jetDR_index]); - } - } - } - - if(passMuon && passMB1){ - h_jetPt_muonMB1Veto[itr_file]->Fill(jetPt_max); - } - - if(passJet && passMB1){ - h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); - } - - if(passJet && passHO){ - h_muonPt_jetHOVeto[itr_file]->Fill(muonPt_max); - } - - if(passMuon && passHO){ - h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); - } - - } - } - h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); - h_nDtRechitClusters_muonVeto[itr_file]->Fill(nPassMuon); - h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); - h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); - h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); - - if(nPassNone>0){ - nPassCluster+=1; - h_dPhiJetMET_noVeto[itr_file]->Fill(dPhi_min); - h_nWheels1_noVeto[itr_file]->Fill(hitWheels1); - h_nWheels10_noVeto[itr_file]->Fill(hitWheels10); - h_nWheels20_noVeto[itr_file]->Fill(hitWheels20); - h_nWheels30_noVeto[itr_file]->Fill(hitWheels30); - h_nWheels50_noVeto[itr_file]->Fill(hitWheels50); - h_nWheels150_noVeto[itr_file]->Fill(hitWheels150); - h_jetPtMET_noVeto[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_noVeto[itr_file]->Fill(jetPt[0]); - } - if(nPassMuon>0){ h_dPhiJetMET_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMET_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMET_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMET_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ - nPassFullDT+=1; - h_dPhiJetMET_fullVeto[itr_file]->Fill(dPhi_min); - h_jetPtMET_fullVeto[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVeto[itr_file]->Fill(jetPt[0]); - } - if(nPassFullPlus>0){ - h_nWheels1_fullVetoPlus[itr_file]->Fill(hitWheels1); - h_nWheels10_fullVetoPlus[itr_file]->Fill(hitWheels10); - h_nWheels20_fullVetoPlus[itr_file]->Fill(hitWheels20); - h_nWheels30_fullVetoPlus[itr_file]->Fill(hitWheels30); - h_nWheels50_fullVetoPlus[itr_file]->Fill(hitWheels50); - h_nWheels150_fullVetoPlus[itr_file]->Fill(hitWheels150); - h_jetPtMET_fullVetoPlus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoPlus[itr_file]->Fill(jetPt[0]); - } - if(nPassFullMinus>0){ - h_nWheels1_fullVetoMinus[itr_file]->Fill(hitWheels1); - h_nWheels10_fullVetoMinus[itr_file]->Fill(hitWheels10); - h_nWheels20_fullVetoMinus[itr_file]->Fill(hitWheels20); - h_nWheels30_fullVetoMinus[itr_file]->Fill(hitWheels30); - h_nWheels50_fullVetoMinus[itr_file]->Fill(hitWheels50); - h_nWheels150_fullVetoMinus[itr_file]->Fill(hitWheels150); - h_jetPtMET_fullVetoMinus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoMinus[itr_file]->Fill(jetPt[0]); - } - - h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); - h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); - - h_nTotalClusteredRechits_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechits_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechits_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechits_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechits_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechits_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechits_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - - h_nTotalClusteredRechits_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); - h_nTotalClusteredRechits_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); - - h_HOMatchedEnergyCluster280_noMB1Veto[itr_file]->Fill(totalSumE); - } - - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0.0; - weightT = 0.0; - rpcBx.clear(); - rpcLayer.clear(); - rpcSpread = -99; - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passMB1_alt = false; - passMuon_alt = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - } - - if(rpcBx.empty() || rpcSpread>0){ - nPassNone+=1; - if(passJet && passMuon && passMB1){ - nPassFull+=1; - if(dtRechitClusterMaxStation[itr_clust]==2){ - h_dtRechitClusterPhiStation2_fullVeto_rpcCR[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - } - if(dtRechitClusterMaxStation[itr_clust]==3){ - h_dtRechitClusterPhiStation3_fullVeto_rpcCR[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - } - if(dtRechitClusterMaxStation[itr_clust]==4){ - h_dtRechitClusterPhiStation4_fullVeto_rpcCR[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - } - if(dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhiClusterMET)<1.0){ - nPassFullPlus_rpcCR+=1; - if(failJetMET){ nFailJetMET += 1; } - if(failJetMET_20){ nFailJetMET_20 += 1; } - if(failJetMET_30){ nFailJetMET_30 += 1; } - if(failJetMET_50){ nFailJetMET_50 += 1; } - if(failJetMET_top4){ nFailJetMET_top4 += 1; } - } - } - } - } - } - if(nPassNone>0){ h_jetPtMET_noVeto_rpcCR[itr_file]->Fill(jetPt_tmp); } - if(nPassFull>0){ h_jetPtMET_fullVeto_rpcCR[itr_file]->Fill(jetPt_tmp); } - if(nPassFullPlus>0){ h_jetPtMET_fullVetoPlus_rpcCR[itr_file]->Fill(jetPt_tmp); } - } - evtNum+=1; - } - itr_file+=1; - - - - cout << "MET > 200: " << nPassMET << endl; - cout << "full Plus RPC CR: " << nPassFullPlus_rpcCR << endl; - cout << "min dPhi(jet,MET) > 0.6: " << nFailJetMET << endl; - cout << "min dPhi(jet [Top 4],MET) > 0.6: " << nFailJetMET_top4 << endl; - cout << "min dPhi(jet [20 GeV],MET) > 0.6: " << nFailJetMET_20 << endl; - cout << "min dPhi(jet [30 GeV],MET) > 0.6: " << nFailJetMET_30 << endl; - cout << "min dPhi(jet [50 GeV],MET) > 0.6: " << nFailJetMET_50 << endl; - cout << "min dPhi(jet,MET) < 0.6: " << nPassJetMET << endl; - cout << "DT cluster: " << nPassCluster << endl; - cout << " " << endl; - - cout << "Full DT Veto: " << nPassFullDT << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch_dt << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread_dt << endl; - cout << "Max Station > 2: " << nPassMaxStation_dt << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_dt << endl; - cout << " " << endl; - - cout << "Full HO Veto: " << nPassFullHO << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch_ho << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread_ho << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho << endl; - - cout << " " << endl; - cout << "DT cluster: " << nPassCluster << endl; - cout << " " << endl; - cout << "Muon veto: " << nPassMuon_std << endl; - cout << "MB1 veto: " << nPassMB1_std << endl; - cout << "Jet+Muon veto: " << nPassJetMuon_std << endl; - cout << "Jet+MB1 veto: " << nPassJetMB1_std << endl; - cout << "Full DT Veto: " << nPassFull_std << endl; - cout << " " << endl; - cout << "Alt Muon veto: " << nPassMuon_alt << endl; - cout << "Alt MB1 veto: " << nPassMB1_alt << endl; - cout << "Alt Muon Full DT veto: " << nPassFull_altMuon << endl; - cout << "Alt MB1 Full DT veto: " << nPassFull_altMB1 << endl; - cout << "Alt Muon MB1 Full DT veto: " << nPassFull_altMuonMB1 << endl; - cout << " " << endl; - cout << "Full DT Selection No Muon: " << nPassFullDTPlus_noMuon << endl; - cout << "Full DT Selection No MB1: " << nPassFullDTPlus_noMB1 << endl; - cout << "Full DT Selection: " << nPassFullDTPlus_std << endl; - cout << "Alt Muon Full DT Selection: " << nPassFullDTPlus_altMuon << endl; - cout << "Alt MB1 Full DT Selection: " << nPassFullDTPlus_altMB1 << endl; - cout << "Alt Muon MB1 Full DT Selection: " << nPassFullDTPlus_altMuonMB1 << endl; - - } - - _ofile->Write(); - _ofile->Close(); - eventList.close(); - -} diff --git a/analyzeData_DT.C b/analyzeData_DT.C deleted file mode 100644 index b04f63e..0000000 --- a/analyzeData_DT.C +++ /dev/null @@ -1,457 +0,0 @@ -R__LOAD_LIBRARY(libTreePlayer) - -#include "helpers.h" - -void analyzeData_beamHalo(){ - - const bool useHDFS(false); - const bool useCERN(false); - TString fsPreFix; - if (useHDFS) { - fsPreFix = "/mnt/hadoop"; - } - else { - fsPreFix = "root://cmsxrootd.fnal.gov/"; - if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; - } - - char name[50]; - char title[100]; - char years[4][10] = {"2018","2017","2016"}; - char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; - char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); - TFile *_ofile = TFile::Open("outData_beamHalo.root","RECREATE"); - - TH2D *h_jetRechitT_jetEta[4]; - TH1D *h_jetPhi[4]; - TH1D *h_nRpcRechits[4]; - TH1D *h_nDtRechits[4]; - TH1D *h_nDtRechits_MB1[4]; - TH1D *h_nDtRechits_MB2[4]; - TH1D *h_nDtRechits_MB3[4]; - TH1D *h_nDtRechits_MB4[4]; - TH1D *h_nDtRechits_Wheelm2[4]; - TH1D *h_nDtRechits_Wheelm1[4]; - TH1D *h_nDtRechits_Wheel0[4]; - TH1D *h_nDtRechits_Wheel1[4]; - TH1D *h_nDtRechits_Wheel2[4]; - TH1D *h_nRpcRechits_Wheelm2[4]; - TH1D *h_nRpcRechits_Wheelm1[4]; - TH1D *h_nRpcRechits_Wheel0[4]; - TH1D *h_nRpcRechits_Wheel1[4]; - TH1D *h_nRpcRechits_Wheel2[4]; - TH1D *h_nRpcRechits_Layer1[4]; - TH1D *h_nRpcRechits_Layer2[4]; - TH1D *h_nRpcRechits_Layer3[4]; - TH1D *h_nRpcRechits_Layer4[4]; - TH1D *h_nRpcRechits_Layer5[4]; - TH1D *h_nRpcRechits_Layer6[4]; - TH1D *h_nStation[4]; - TH1D *h_nStationLowThresh[4]; - TH1D *h_nStationThresh[4]; - TH1D *h_nWheel[4]; - TH1D *h_nWheelLowThresh[4]; - TH1D *h_nWheelThresh[4]; - TH2D *h_dtRechitX_dtRechitY[4]; - TH2D *h_dtRechitZ_dtRechitR[4]; - TH2D *h_rpcRechitX_rpcRechitY[4]; - TH2D *h_rpcRechitZ_rpcRechitR[4]; - TH1D *h_nDtRechitClusters_noVeto[4]; - TH1D *h_nDtRechitClusters_fullVeto[4]; - TH1D *h_nDtRechitClusters_fullVetoPlus[4]; - - Int_t wheelCount[5]; - Int_t stationCount[4]; - Int_t rpcLayerCount[6]; - Int_t rpcWheelCount[5]; - Int_t rechitWheel = -99; - Int_t rechitStation = -99; - Int_t rpcWheel = -99; - Int_t rpcLayer = -99; - Int_t nWheel = -1; - Int_t nWheelLowThresh = -1; - Int_t nWheelThresh = 1; - Int_t nStation = -1; - Int_t nStationLowThresh = -1; - Int_t nStationThresh = -1; - - Double_t dPhi_tmp = 0.0; - Double_t dPhi_min = 0.0; - Double_t dPhiClusterMET = 0.0; - vector rpcBx = {}; - Int_t rpcSpread = 0; - - Int_t evtNum = 0; - Int_t itr_file = 0; - - Bool_t passCR = false; - Bool_t passMuon = false; - Bool_t passMB1 = false; - Bool_t passJet = false; - Int_t nPassNoVeto = 0; - Int_t nPassFull = 0; - Int_t nPassFullPlus = 0; - - for(Int_t itr_year=0; itr_year<3; itr_year++){ - - sprintf(name,"h_jetRechitT_jetEta_%s",years[itr_year]); - h_jetRechitT_jetEta[itr_year] = new TH2D(name,"",300,-15,15,150,-1.5,1.5); - - sprintf(name,"h_jetPhi_%s",years[itr_year]); - h_jetPhi[itr_year] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_nDtRechits_%s",years[itr_year]); - h_nDtRechits[itr_year] = new TH1D(name,"",500,0,5000); - - sprintf(name,"h_nRpcRechits_%s",years[itr_year]); - h_nRpcRechits[itr_year] = new TH1D(name,"",250,0,500); - - sprintf(name,"h_nDtRechits_MB1_%s",years[itr_year]); - h_nDtRechits_MB1[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_MB2_%s",years[itr_year]); - h_nDtRechits_MB2[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_MB3_%s",years[itr_year]); - h_nDtRechits_MB3[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_MB4_%s",years[itr_year]); - h_nDtRechits_MB4[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_Wheelm2_%s",years[itr_year]); - h_nDtRechits_Wheelm2[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_Wheelm1_%s",years[itr_year]); - h_nDtRechits_Wheelm1[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_Wheel0_%s",years[itr_year]); - h_nDtRechits_Wheel0[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_Wheel1_%s",years[itr_year]); - h_nDtRechits_Wheel1[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nDtRechits_Wheel2_%s",years[itr_year]); - h_nDtRechits_Wheel2[itr_year] = new TH1D(name,"",250,0,2500); - - sprintf(name,"h_nRpcRechits_Wheelm2_%s",years[itr_year]); - h_nRpcRechits_Wheelm2[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Wheelm1_%s",years[itr_year]); - h_nRpcRechits_Wheelm1[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Wheel0_%s",years[itr_year]); - h_nRpcRechits_Wheel0[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Wheel1_%s",years[itr_year]); - h_nRpcRechits_Wheel1[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Wheel2_%s",years[itr_year]); - h_nRpcRechits_Wheel2[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer1_%s",years[itr_year]); - h_nRpcRechits_Layer1[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer2_%s",years[itr_year]); - h_nRpcRechits_Layer2[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer3_%s",years[itr_year]); - h_nRpcRechits_Layer3[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer4_%s",years[itr_year]); - h_nRpcRechits_Layer4[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer5_%s",years[itr_year]); - h_nRpcRechits_Layer5[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nRpcRechits_Layer6_%s",years[itr_year]); - h_nRpcRechits_Layer6[itr_year] = new TH1D(name,"",500,0,2500); - - sprintf(name,"h_nStation_%s",years[itr_year]); - h_nStation[itr_year] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_nStationLowThresh_%s",years[itr_year]); - h_nStationLowThresh[itr_year] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_nStationThresh_%s",years[itr_year]); - h_nStationThresh[itr_year] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_nWheel_%s",years[itr_year]); - h_nWheel[itr_year] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheelLowThresh_%s",years[itr_year]); - h_nWheelLowThresh[itr_year] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheelThresh_%s",years[itr_year]); - h_nWheelThresh[itr_year] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitX_dtRechitY_%s",years[itr_year]); - h_dtRechitX_dtRechitY[itr_year] = new TH2D(name,"",320,-800,800,320,-800,800); - - sprintf(name,"h_rpcRechitX_rpcRechitY_%s",years[itr_year]); - h_rpcRechitX_rpcRechitY[itr_year] = new TH2D(name,"",320,-800,800,320,-800,800); - - sprintf(name,"h_dtRechitZ_dtRechitR_%s",years[itr_year]); - h_dtRechitZ_dtRechitR[itr_year] = new TH2D(name,"",240,-600,600,80,400,800); - - sprintf(name,"h_rpcRechitZ_rpcRechitR_%s",years[itr_year]); - h_rpcRechitZ_rpcRechitR[itr_year] = new TH2D(name,"",240,-600,600,80,400,800); - - sprintf(name,"h_nDtRechitClusters_noVeto_%s",years[itr_year]); - h_nDtRechitClusters_noVeto[itr_year] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_nDtRechitClusters_fullVeto_%s",years[itr_year]); - h_nDtRechitClusters_fullVeto[itr_year] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_nDtRechitClusters_fullVetoPlus_%s",years[itr_year]); - h_nDtRechitClusters_fullVetoPlus[itr_year] = new TH1D(name,"",5,0,5); - - TFile *_file; - if(strcmp(years[itr_year],"All")==0){ - _file = TFile::Open(dir+years[itr_year]+"/v4/v4/normalized/Run2_displacedJetMuonNtupler_V1p15_Data2016_Data2017_Data2018-HighMET_goodLumi.root"); - } - else{ - _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); - } - - TTreeReader treeReader("MuonSystem",_file); - - TTreeReaderValue runNum(treeReader,"runNum"); - TTreeReaderValue lumiSec(treeReader,"lumiSec"); - TTreeReaderValue eventNum(treeReader,"evtNum"); - TTreeReaderValue MET(treeReader,"met"); - TTreeReaderValue METphi(treeReader,"metPhi"); - - TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); - TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); - TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); - TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); - TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); - TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); - TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); - TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); - TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); - TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); - TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); - TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); - TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); - TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); - TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); - TTreeReaderArray dtRechitClusterNSegmentStation2(treeReader,"dtRechitClusterNSegmentStation2"); - TTreeReaderArray dtRechitClusterNSegmentStation3(treeReader,"dtRechitClusterNSegmentStation3"); - TTreeReaderArray dtRechitClusterNSegmentStation4(treeReader,"dtRechitClusterNSegmentStation4"); - TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); - TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); - TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); - TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - - TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); - TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); - TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); - TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); - TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); - TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); - TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); - TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - - TTreeReaderValue nJets(treeReader,"nJets"); - TTreeReaderArray jetPt(treeReader,"jetPt"); - TTreeReaderArray jetEta(treeReader,"jetEta"); - TTreeReaderArray jetPhi(treeReader,"jetPhi"); - TTreeReaderArray jetRechitT(treeReader,"jetRechitT"); - TTreeReaderArray jetRechitT_rms(treeReader,"jetRechitT_rms"); - TTreeReaderArray jetElectronEnergyFraction(treeReader,"jetElectronEnergyFraction"); - TTreeReaderArray jetPhotonEnergyFraction(treeReader,"jetPhotonEnergyFraction"); - TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); - TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); - TTreeReaderArray jetMuonEnergyFraction(treeReader,"jetMuonEnergyFraction"); - - TTreeReaderValue nRPCRechits(treeReader,"nRpc"); - TTreeReaderArray RPCRechitX(treeReader,"rpcX"); - TTreeReaderArray RPCRechitY(treeReader,"rpcY"); - TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); - TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); - TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); - - _ofile->cd(); - evtNum = 0; - cout << "Data" << years[itr_year] << endl; - while(treeReader.Next()){ - fill_n(wheelCount, 5, 0); - fill_n(stationCount, 4, 0); - fill_n(rpcLayerCount, 6, 0); - fill_n(rpcWheelCount, 5, 0); - nWheel = 0; - nWheelLowThresh = 0; - nWheelThresh = 0; - nStation = 0; - nStationLowThresh = 0; - nStationThresh = 0; - passCR = false; - nPassNoVeto = 0; - nPassFull = 0; - nPassFullPlus = 0; - dPhi_min = 999.; - if(evtNum%100000==0){ cout << evtNum << " of " << treeReader.GetEntries(1) << endl; } - - if(*MET > 200){ - - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - } - } - } - if(fabs(dPhi_min)<0.6){ passCR = true; } - - if(passCR){ - - if(*nDtRechits<750){ - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - h_dtRechitX_dtRechitY[itr_year]->Fill(dtRechitX[itr_dt],dtRechitY[itr_dt]); - h_dtRechitZ_dtRechitR[itr_year]->Fill(dtRechitZ[itr_dt],sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))); - rechitWheel = getWheel(dtRechitZ[itr_dt]); - rechitWheel+=2; - if(rechitWheel>=0 && rechitWheel<5){ - wheelCount[rechitWheel] += 1; - } - rechitStation = getStation(dtRechitX[itr_dt],dtRechitY[itr_dt]); - if(rechitStation>-1){ - stationCount[rechitStation-1] += 1; - } - } - } - else{ - fill_n(wheelCount, 5, 150); - fill_n(stationCount, 4, 150); - } - for(Int_t itr_wheel = 0; itr_wheel<5; itr_wheel++){ - if(wheelCount[itr_wheel] > 0){ nWheel += 1; } - if(wheelCount[itr_wheel] > 4){ nWheelLowThresh += 1; } - if(wheelCount[itr_wheel] > 12){ nWheelThresh += 1; } - } - for(Int_t itr_station = 0; itr_station<4; itr_station++){ - if(stationCount[itr_station]>0){ nStation += 1; } - if(itr_station<3){ - if(stationCount[itr_station]>12){ nStationThresh += 1; } - if(stationCount[itr_station]>4){ nStationLowThresh += 1; } - } - else{ - if(stationCount[itr_station]>8){ nStationThresh += 1; } - if(stationCount[itr_station]>2){ nStationLowThresh += 1; } - } - } - - h_nDtRechits[itr_year]->Fill(*nDtRechits); - h_nRpcRechits[itr_year]->Fill(*nRPCRechits); - h_nDtRechits_MB1[itr_year]->Fill(stationCount[0]); - h_nDtRechits_MB2[itr_year]->Fill(stationCount[1]); - h_nDtRechits_MB3[itr_year]->Fill(stationCount[2]); - h_nDtRechits_MB4[itr_year]->Fill(stationCount[3]); - h_nDtRechits_Wheelm2[itr_year]->Fill(wheelCount[0]); - h_nDtRechits_Wheelm1[itr_year]->Fill(wheelCount[1]); - h_nDtRechits_Wheel0[itr_year]->Fill(wheelCount[2]); - h_nDtRechits_Wheel1[itr_year]->Fill(wheelCount[3]); - h_nDtRechits_Wheel2[itr_year]->Fill(wheelCount[4]); - h_nStation[itr_year]->Fill(nStation); - h_nStationLowThresh[itr_year]->Fill(nStationLowThresh); - h_nStationThresh[itr_year]->Fill(nStationThresh); - h_nWheel[itr_year]->Fill(nWheel); - h_nWheelLowThresh[itr_year]->Fill(nWheelLowThresh); - h_nWheelThresh[itr_year]->Fill(nWheelThresh); - - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - h_jetRechitT_jetEta[itr_year]->Fill(jetRechitT[itr_jet],jetEta[itr_jet]); - h_jetPhi[itr_year]->Fill(jetPhi[itr_jet]); - } - - for(Int_t itr_rpc = 0; itr_rpc<*nRPCRechits; itr_rpc++){ - if(RPCRechitZ[itr_rpc]<661.){ - h_rpcRechitX_rpcRechitY[itr_year]->Fill(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc]); - h_rpcRechitZ_rpcRechitR[itr_year]->Fill(RPCRechitZ[itr_rpc],sqrt(pow(RPCRechitX[itr_rpc],2)+pow(RPCRechitY[itr_rpc],2))); - rpcLayer = getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc]); - if(rpcLayer>-1){ - rpcLayerCount[rpcLayer-1]+=1; - } - rpcWheel = getWheel(RPCRechitZ[itr_rpc]); - rpcWheel+=2; - if(rpcWheel>=0 && rpcWheel<5){ - rpcWheelCount[rpcWheel] += 1; - } - } - } - - h_nRpcRechits_Layer1[itr_year]->Fill(rpcLayerCount[0]); - h_nRpcRechits_Layer2[itr_year]->Fill(rpcLayerCount[1]); - h_nRpcRechits_Layer3[itr_year]->Fill(rpcLayerCount[2]); - h_nRpcRechits_Layer4[itr_year]->Fill(rpcLayerCount[3]); - h_nRpcRechits_Layer5[itr_year]->Fill(rpcLayerCount[4]); - h_nRpcRechits_Layer6[itr_year]->Fill(rpcLayerCount[5]); - h_nRpcRechits_Wheelm2[itr_year]->Fill(rpcWheelCount[0]); - h_nRpcRechits_Wheelm1[itr_year]->Fill(rpcWheelCount[1]); - h_nRpcRechits_Wheel0[itr_year]->Fill(rpcWheelCount[2]); - h_nRpcRechits_Wheel1[itr_year]->Fill(rpcWheelCount[3]); - h_nRpcRechits_Wheel2[itr_year]->Fill(rpcWheelCount[4]); - - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - rpcBx.clear(); - passJet = false; - passMuon = false; - passMB1 = false; - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterSize[itr_clust]>50 && ((dtRechitClusterPhi[itr_clust]<0.4 || dtRechitClusterPhi[itr_clust]>0.6) || (*runNum<275.75e3 || *runNum>275.95e3))){ - nPassNoVeto += 1; - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - rpcBx.push_back(RPCRechitBx[itr_rpc]); - } - } - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - } - - if(passJet && passMuon && passMB1){ - nPassFull += 1; - - if(!rpcBx.empty()){ - if(rpcSpread==0){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhiClusterMET)<1.0){ - nPassFullPlus += 1; - } - } - } - } - } - } - } - - h_nDtRechitClusters_noVeto[itr_year]->Fill(nPassNoVeto); - h_nDtRechitClusters_fullVeto[itr_year]->Fill(nPassFull); - h_nDtRechitClusters_fullVetoPlus[itr_year]->Fill(nPassFullPlus); - - } - } - evtNum+=1; - } - } - - _ofile->Write(); - _ofile->Close(); - -} diff --git a/analyzeSignal.C b/analyzeSignal.C deleted file mode 100644 index 4c22fed..0000000 --- a/analyzeSignal.C +++ /dev/null @@ -1,2785 +0,0 @@ -R__LOAD_LIBRARY(libTreePlayer) - -#include "helpers.h" - -void analyzeSignal(){ - - const bool useHDFS(false); - const bool useCERN(false); - TString fsPreFix; - if (useHDFS) { - fsPreFix = "/mnt/hadoop"; - } - else { - fsPreFix = "root://cmsxrootd.fnal.gov/"; - if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; - } - - char name[50]; - char title[100]; - char mX[3][10] = {"15","40","55"}; - //char mX[2][10] = {"25","450"}; - //char ctau[10] = "1m"; - char ctau[10] = "10000"; - char years[3][20] = {"MC_Summer16","MC_Fall17","MC_Fall18"}; - //TString dir("/storage/user/mcitron/signalPointsGGHWithRPCWithFlags/"); - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); - //TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/"); - TFile *_ofile = TFile::Open("outSig_central_V1p17_altTest5.root","RECREATE"); - Float_t lumi[3] = {37.8,44.98,63.67}; - Float_t xSec = 48.58; - Float_t weight; - - TH1D *h_dPhiClusterMET[4]; - TH1D *h_dPhiClusterMETMax[4]; - TH1D *h_dPhiJetMET[4]; - TH1D *h_jetMet_dPhiMin4[4]; - TH1D *h_MET[4]; - TH1D *h_jetPt[4]; - - TH1D *h_dPhiJetMETBarrel_noVeto[4]; - TH1D *h_dPhiJetMETBarrel_jetVeto[4]; - TH1D *h_dPhiJetMETBarrel_muonVeto[4]; - TH1D *h_dPhiJetMETBarrel_MB1Veto[4]; - TH1D *h_dPhiJetMETBarrel_noMB1Veto[4]; - TH1D *h_dPhiJetMETBarrel_fullVeto[4]; - TH1D *h_dPhiJetMETMagnet_noVeto[4]; - TH1D *h_dPhiJetMETMagnet_jetVeto[4]; - TH1D *h_dPhiJetMETMagnet_muonVeto[4]; - TH1D *h_dPhiJetMETMagnet_MB1Veto[4]; - TH1D *h_dPhiJetMETMagnet_noMB1Veto[4]; - TH1D *h_dPhiJetMETMagnet_fullVeto[4]; - TH1D *h_dPhiJetMETMagnet_fullHOVeto[4]; - TH1D *h_dPhiJetMETMagnet[4]; - TH1D *h_dPhiJetMETAll_noVeto[4]; - TH1D *h_dPhiJetMETAll_jetVeto[4]; - TH1D *h_dPhiJetMETAll_muonVeto[4]; - TH1D *h_dPhiJetMETAll_MB1Veto[4]; - TH1D *h_dPhiJetMETAll_noMB1Veto[4]; - TH1D *h_dPhiJetMETAll_fullVeto[4]; - - TH1D *h_nDtRechitClusters_noVeto[4]; - TH1D *h_dtRechitClusterSize_noVeto[4]; - TH1D *h_nTotalClusteredRechits_noVeto[4]; - TH1D *h_dtRechitClusterMaxStation_noVeto[4]; - TH1D *h_dtRechitClusterNStation_noVeto[4]; - TH1D *h_dPhiClusterMET_noVeto[4]; - TH1D *h_dtRechitClusterXSpread_noVeto[4]; - TH1D *h_dtRechitClusterYSpread_noVeto[4]; - TH1D *h_dtRechitClusterZSpread_noVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_noVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_noVeto[4]; - TH1D *h_nRPCMatched_noVeto[4]; - TH1D *h_RPCMatchedBx_noVeto[4]; - TH1D *h_RPCMatchedBxSpread_noVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_noVeto[4]; - TH1D *h_nRPCMatched_Spread0_noVeto[4]; - TH2D *h_npv_nDtRechitClusters_noVeto[4]; - - TH1D *h_nDtRechitClusters_muonVeto[4]; - TH1D *h_dtRechitClusterSize_muonVeto[4]; - TH1D *h_nTotalClusteredRechits_muonVeto[4]; - TH1D *h_dtRechitClusterMaxStation_muonVeto[4]; - TH1D *h_dtRechitClusterNStation_muonVeto[4]; - TH1D *h_dPhiClusterMET_muonVeto[4]; - TH1D *h_dtRechitClusterXSpread_muonVeto[4]; - TH1D *h_dtRechitClusterYSpread_muonVeto[4]; - TH1D *h_dtRechitClusterZSpread_muonVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_muonVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_muonVeto[4]; - TH1D *h_nRPCMatched_muonVeto[4]; - TH1D *h_RPCMatchedBx_muonVeto[4]; - TH1D *h_RPCMatchedBxSpread_muonVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; - TH1D *h_nRPCMatched_Spread0_muonVeto[4]; - - TH1D *h_nDtRechitClusters_jetVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; - TH1D *h_dtRechitClusterSizeAll_jetVeto[4]; - TH1D *h_dtRechitClusterSize_jetVeto[4]; - TH1D *h_nTotalClusteredRechits_jetVeto[4]; - TH1D *h_dtRechitClusterMaxStation_jetVeto[4]; - TH1D *h_dtRechitClusterNStation_jetVeto[4]; - TH1D *h_dPhiClusterMET_jetVeto[4]; - TH1D *h_dtRechitClusterXSpread_jetVeto[4]; - TH1D *h_dtRechitClusterYSpread_jetVeto[4]; - TH1D *h_dtRechitClusterZSpread_jetVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_jetVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_jetVeto[4]; - TH1D *h_nRPCMatched_jetVeto[4]; - TH1D *h_nRPCMatchedMagnet_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer1_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer2_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer3_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer4_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer1_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer2_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer3_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer4_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_jetVeto[4]; - TH1D *h_RPCMatchedBxSpread_jetVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_jetVeto[4]; - TH1D *h_nRPCMatched_Spread0_jetVeto[4]; - - TH1D *h_nDtRechitClusters_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeBarrel_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeMagnet_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeAll_MB1Veto[4]; - TH1D *h_dtRechitClusterSize_MB1Veto[4]; - TH1D *h_nTotalClusteredRechits_MB1Veto[4]; - TH1D *h_dtRechitClusterMaxStation_MB1Veto[4]; - TH1D *h_dtRechitClusterNStation_MB1Veto[4]; - TH1D *h_dPhiClusterMET_MB1Veto[4]; - TH1D *h_dtRechitClusterXSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterYSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterZSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterEtaSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterPhiSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_MB1Veto[4]; - TH1D *h_RPCMatchedBx_MB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_Spread0_MB1Veto[4]; - TH1D *h_RPCMatchedBx_Spread0_MB1Veto[4]; - - TH1D *h_nDtRechitClusters_fullVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_fullVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_fullVeto[4]; - TH1D *h_dtRechitClusterSizeAll_fullVeto[4]; - TH1D *h_dtRechitClusterSize_fullVeto[4]; - TH1D *h_nTotalClusteredRechits_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullHOVeto[4]; - TH1D *h_dtRechitClusterNStation_fullVeto[4]; - TH1D *h_dtRechitClusterNStationUnclustered_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshStation_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshLowStation_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshStationUnclustered_fullVeto[4]; - TH1D *h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullHOVeto[4]; - TH1D *h_dtRechitClusterXSpread_fullVeto[4]; - TH1D *h_dtRechitClusterYSpread_fullVeto[4]; - TH1D *h_dtRechitClusterZSpread_fullVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVeto[4]; - TH1D *h_nRPCMatched_fullVeto[4]; - TH1D *h_nRPCMatched_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullHOVeto[4]; - TH1D *h_nRPCMatched_Spread0_fullVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_fullVeto[4]; - - TH1D *h_dtRechitClusterEta_fullVeto[4]; - TH1D *h_dtRechitClusterPhi_fullVeto[4]; - TH1D *h_dtRechitClusterR_fullVeto[4]; - TH1D *h_dtRechitClusterZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZFine_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels50_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels25_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels1_fullVeto[4]; - TH1D *h_dtRechitClusterMaxWheel_fullVeto[4]; - TH2D *h_npv_nDtRechitClusters_fullVeto[4]; - TH1D *h_gLLPpt_fullVeto[4]; - TH1D *h_gLLPpt_Bx0_fullVeto[4]; - TH1D *h_gLLPpt_Bx1_fullVeto[4]; - TH1D *h_gLLP_travel_time_fullVeto[4]; - - TH1D *h_RPCMatchedBx_invertedJetVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuonVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuJetVeto[4]; - - TH1D *h_dtRechitClusterSize_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeBarrel_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeMagnet_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeAll_noMB1Veto[4]; - TH1D *h_dtRechitClusterNStation_noMB1Veto[4]; - TH1D *h_dtRechitClusterNRechitsMB1_noMB1Veto[4]; - TH1D *h_dtRechitClusterPercentRechitsMB1_noMB1Veto[4]; - TH1D *h_nRPCMatched_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer1_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer2_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer12_noMB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_noMB1Veto[4]; - - TH1D *h_dtRechitClusterSizeBarrel_HOVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_HOVeto[4]; - TH1D *h_dtRechitClusterSizeAll_HOVeto[4]; - - TH1D *h_dtRechitClusterSizeBarrel_fullHOVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_fullHOVeto[4]; - TH1D *h_dtRechitClusterSizeAll_fullHOVeto[4]; - - TH1D *h_nTotalClusteredRechitsBarrel_noVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_noVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_noVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsAll_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsAll_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullHOVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullHOVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_fullHOVeto[4]; - - TH1D *h_dtRechitClusterSize_RPCMatch[4]; - TH1D *h_dtRechitClusterSize_RPCSpread0[4]; - TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullVetoPlus[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterXSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterYSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterZSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEta_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhi_fullVetoPlus[4]; - TH2D *h_dtRechitClusterEtaPhi_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoMinus[4]; - TH1D *h_dtRechitClusterNWheel_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterNWheel_fullHOVetoPlus[4]; - - TH1D *h_HOMatchedEnergyCluster280Magnet_noMB1Veto[4]; - - TH1D *h_HOTime_fullHOVeto[4]; - - TH1D *h_muonPt_jetMB1Veto[4]; - TH1D *h_jetPt_muonMB1Veto[4]; - TH1D *h_MB1Rechits_jetMuonVeto[4]; - TH1D *h_muonPt_jetHOVeto[4]; - TH1D *h_jetPt_muonHOVeto[4]; - TH1D *h_HOEnergy_jetMuonVeto[4]; - - TH1D *h_muonDR_fullVeto[4]; - TH1D *h_muonDR_RPCMatch[4]; - TH1D *h_muonDR_RPCSpread0[4]; - TH1D *h_jetDR_fullVeto[4]; - TH1D *h_jetDR_RPCMatch[4]; - TH1D *h_jetDR_RPCSpread0[4]; - TH1D *h_muonDR_fullHOVeto[4]; - TH1D *h_muonDR_HORPCMatch[4]; - TH1D *h_muonDR_HORPCSpread0[4]; - TH1D *h_jetDR_fullHOVeto[4]; - TH1D *h_jetDR_HORPCMatch[4]; - TH1D *h_jetDR_HORPCSpread0[4]; - - TH1D *h_decayVertexRadius_noVeto[4]; - TH1D *h_HOEnergy_jetVeto[4]; - TH1D *h_dRClusterRPC_jetVeto[4]; - TH1D *h_dRClusterHO_jetVeto[4]; - - TH1D *h_jetDR_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPt_minDR_fullHOVetoPlus[4]; - TH1D *h_jetEta_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPhi_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetDR_minDR_vetoJet[4]; - TH1D *h_jetPt_minDR_vetoJet[4]; - TH1D *h_jetEta_minDR_vetoJet[4]; - TH1D *h_jetPhi_minDR_vetoJet[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_vetoJet[4]; - - TH1D *h_nWheels1_noCluster[4]; - TH1D *h_nWheels10_noCluster[4]; - TH1D *h_nWheels20_noCluster[4]; - TH1D *h_nWheels30_noCluster[4]; - TH1D *h_nWheels50_noCluster[4]; - TH1D *h_nWheels150_noCluster[4]; - TH1D *h_nWheels1_noVeto[4]; - TH1D *h_nWheels1_fullVetoPlus[4]; - TH1D *h_nWheels1_fullVetoMinus[4]; - TH1D *h_nWheels10_noVeto[4]; - TH1D *h_nWheels10_fullVetoPlus[4]; - TH1D *h_nWheels10_fullVetoMinus[4]; - TH1D *h_nWheels20_noVeto[4]; - TH1D *h_nWheels20_fullVetoPlus[4]; - TH1D *h_nWheels20_fullVetoMinus[4]; - TH1D *h_nWheels30_noVeto[4]; - TH1D *h_nWheels30_fullVetoPlus[4]; - TH1D *h_nWheels30_fullVetoMinus[4]; - TH1D *h_nWheels50_noVeto[4]; - TH1D *h_nWheels50_fullVetoPlus[4]; - TH1D *h_nWheels50_fullVetoMinus[4]; - TH1D *h_nWheels150_noVeto[4]; - TH1D *h_nWheels150_fullVetoPlus[4]; - TH1D *h_nWheels150_fullVetoMinus[4]; - - TH1D *h_jetPtMax_noVeto[4]; - TH1D *h_jetPtMax_fullVeto[4]; - TH1D *h_jetPtMax_fullVetoPlus[4]; - TH1D *h_jetPtMax_fullVetoMinus[4]; - TH1D *h_jetPtMET_noVeto[4]; - TH1D *h_jetPtMET_fullVeto[4]; - TH1D *h_jetPtMET_fullVetoPlus[4]; - TH1D *h_jetPtMET_fullVetoMinus[4]; - - Double_t dPhi_tmp = 0.0; - Double_t dPhiClusterMET = 0.0; - Double_t dPhiClusterMET_max = 0.0; - Double_t dPhi_min = 999.; - Double_t clustSizeMax = 0.; - Double_t dPhi_clust = 999.; - Double_t jetPt_tmp = 0.0; - Double_t dPhi_minTop4 = 0.0; - Double_t dPhi_min20 = 0.0; - Double_t dPhi_min30 = 0.0; - Double_t dPhi_min50 = 0.0; - Double_t muonPt_max = 0.0; - Double_t muonDR_min = 0.0; - Double_t jetPt_max = 0.0; - Double_t jetDR_min = 0.0; - Int_t jetDR_index = -1; - - Int_t rechitCount[5]; - Int_t stationCount[4]; - Int_t rechitWheel = -99; - Int_t rechitStation = -99; - Int_t hitWheels1 = -1; - Int_t hitWheels10 = -1; - Int_t hitWheels20 = -1; - Int_t hitWheels30 = -1; - Int_t hitWheels50 = -1; - Int_t hitWheels150 = -1; - Int_t nStationUnclustered = -1; - Int_t nThreshStation = -1; - Int_t nThreshLowStation = -1; - Int_t nThreshStationUnclustered = -1; - Int_t nThreshLowStationUnclustered = -1; - - vector muStatus = {}; - Double_t dR_tmp = 0.0; - Int_t nMatched = 0; - vector goodStatus = {1,44,51,52,91}; - vector rpcBx = {}; - vector rpcLayer = {}; - vector zWheel = {}; - Int_t rpcSpread = 0; - Float_t rpcMean = 0; - - Int_t evtNum = 0; - Int_t totalNum = 0; - Bool_t goodEvt = false; - Int_t itr_file = 0; - Int_t goodJets = 0; - Bool_t matchJet = false; - Bool_t matchMuon = false; - Int_t match = 0; - Int_t matchLayer1 = 0; - Int_t matchLayer2 = 0; - Int_t matchLayer3 = 0; - Int_t matchLayer4 = 0; - Int_t matchHO = 0; - Float_t sumE = 0.0; - Float_t totalSumE = 0.0; - Float_t weightT = 0.0; - Int_t llp_itr = -1; - - Bool_t passMuon = false; - Bool_t passMuon_alt = false; - Bool_t passMB1_alt = false; - Bool_t passJet = false; - Bool_t passMB1 = false; - Bool_t passHO = false; - Bool_t passInvertedJet = false; - Bool_t passInvertedMuon = false; - Bool_t passInvertedMuJet = false; - Int_t nPassMuon = 0; - Int_t nPassJet = 0; - Int_t nPassMuon_std = 0; - Int_t nPassMB1_std = 0; - Int_t nPassMuon_alt = 0; - Int_t nPassMB1_alt = 0; - Int_t nPassJetMuon = 0; - Int_t nPassMB1 = 0; - Int_t nPassHO = 0; - Int_t nPassJetMuon_std = 0; - Int_t nPassJetMB1_std = 0; - Int_t nPassFull = 0; - Int_t nPassFull_std = 0; - Int_t nPassFull_altMuon = 0; - Int_t nPassFull_altMB1 = 0; - Int_t nPassFull_altMuonMB1 = 0; - Int_t nPassFullHO = 0; - Int_t nPassNone = 0; - Int_t nPassFullPlus = 0; - Int_t nPassFullDTPlus_noMuon = 0; - Int_t nPassFullDTPlus_noMB1 = 0; - Int_t nPassFullDTPlus_std = 0; - Int_t nPassFullDTPlus_altMuon = 0; - Int_t nPassFullDTPlus_altMB1 = 0; - Int_t nPassFullDTPlus_altMuonMB1 = 0; - Int_t nPassFullMinus = 0; - Int_t totalBarrelEvents = 0; - Int_t totalMagnetEvents = 0; - Int_t totalEvents = 0; - Int_t totalClusteredNone = 0; - Int_t totalClusteredNoMB1 = 0; - Int_t totalClusteredJet = 0; - Int_t totalClusteredMB1 = 0; - Int_t totalClusteredHO = 0; - Int_t totalClusteredFull = 0; - Int_t totalClusteredFullHO = 0; - Float_t noEff = 0.0; - Float_t muonEff = 0.0; - Float_t jetEff = 0.0; - Float_t MB1Eff = 0.0; - Float_t HOEff = 0.0; - Float_t fullHOEff = 0.0; - Float_t fullEff = 0.0; - - Bool_t goodDecay = false; - Bool_t magnetDecay = false; - - Bool_t passMuonEvent_std=false; - Bool_t passMB1Event_std=false; - Bool_t passMuonEvent_alt=false; - Bool_t passMB1Event_alt=false; - Bool_t passJetMB1_std=false; - Bool_t passJetMuon_std=false; - Bool_t passFull_std = false; - Bool_t passFull_altMuon = false; - Bool_t passFull_altMB1 = false; - Bool_t passFull_altMuonMB1 = false; - Bool_t passFullDTPlus_noMuon = false; - Bool_t passFullDTPlus_noMB1 = false; - Bool_t passFullDTPlus_std = false; - Bool_t passFullDTPlus_altMuon = false; - Bool_t passFullDTPlus_altMB1 = false; - Bool_t passFullDTPlus_altMuonMB1 = false; - - Bool_t passNoVeto = false; - Bool_t passFullVeto = false; - Bool_t passRPCMatch = false; - Bool_t passRPCSpread = false; - Bool_t passMaxStation = false; - Bool_t passDeltaPhi = false; - Bool_t passFullVeto_ho = false; - Bool_t passRPCMatch_ho = false; - Bool_t passRPCSpread_ho = false; - Bool_t passMaxStation_ho = false; - Bool_t passDeltaPhi_ho = false; - Bool_t passJetMET = false; - Bool_t passJetMET_20 = false; - Bool_t passJetMET_30 = false; - Bool_t passJetMET_50 = false; - Bool_t passJetMET_top4 = false; - - Float_t nPassMET = 0; - Float_t nPassDTDecay = 0; - Float_t nPassJetMET = 0; - Float_t nPassJetMET_top4 = 0; - Float_t nPassJetMET_20 = 0; - Float_t nPassJetMET_30 = 0; - Float_t nPassJetMET_50 = 0; - Float_t nPassNoVeto = 0; - Float_t nPassFullVeto = 0; - - Float_t nPassMaxStation = 0; - Float_t nPassDeltaPhi = 0; - Float_t nPassRPCMatch = 0; - Float_t nPassRPCSpread = 0; - - Float_t nPassHODecay = 0; - Float_t nPassNoVeto_ho = 0; - Float_t nPassFullVeto_ho = 0; - Float_t nPassRPCMatch_ho = 0; - Float_t nPassRPCSpread_ho = 0; - Float_t nPassDeltaPhi_ho = 0; - - Int_t totalClusteredFullPlus = 0; - Int_t totalClusteredFullHOPlus = 0; - - for(Int_t itr_mX=0; itr_mX<3; itr_mX++){ - sprintf(name,"h_jetMet_dPhiMin4_%s_%s",mX[itr_mX],ctau); - h_jetMet_dPhiMin4[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMET[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMET_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMETMax_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMETMax[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_MET_%s_%s",mX[itr_mX],ctau); - h_MET[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_jetPt_%s_%s",mX[itr_mX],ctau); - h_jetPt[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nDtRechitClusters_noVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_noVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_noVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_muonVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_jetVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnet_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer1_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer1_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer2_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer2_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer3_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer3_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer4_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer4_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer1_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer2_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer3_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer4_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_RPCMatchedBxSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_dtRechitClusterSizeBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nDtRechitClusters_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_MB1Veto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterMaxStation_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStationUnclustered_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNThreshStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshLowStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNThreshLowStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshStationUnclustered_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNThreshStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNThreshLowStationUnclustered_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_fullVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatched_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_fullHOVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_fullVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBxSpread_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_fullHOVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBx_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_dtRechitClusterEta_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEta_fullVeto[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhi_fullVeto[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterR_fullVeto[itr_file] = new TH1D(name,"",40,0,800); - - sprintf(name,"h_dtRechitClusterZ_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZ_fullVeto[itr_file] = new TH1D(name,"",120,-600,600); - - sprintf(name,"h_dtRechitClusterRZ_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterRZ_fullVeto[itr_file] = new TH2D(name,"",120,-600,600,40,400,800); - - sprintf(name,"h_dtRechitClusterRZFine_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterRZFine_fullVeto[itr_file] = new TH2D(name,"",1200,-600,600,400,400,800); - - sprintf(name,"h_dtRechitClusterNWheels50_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels50_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels25_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels25_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels1_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels1_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterMaxWheel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxWheel_fullVeto[itr_file] = new TH1D(name,"",6,-3,3); - - sprintf(name,"h_gLLPpt_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLPpt_Bx0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_Bx0_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLPpt_Bx1_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_Bx1_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLP_travel_time_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLP_travel_time_fullVeto[itr_file] = new TH1D(name,"",100,0,10000); - - sprintf(name,"h_npv_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); - h_npv_nDtRechitClusters_fullVeto[itr_file] = new TH2D(name,"",10,0,10,5,0,5); - - sprintf(name,"h_RPCMatchedBx_invertedJetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedMuonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterSizeBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterNStation_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_noMB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterPercentRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_nRPCMatched_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer1_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer2_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer2_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer12_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer12_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_noMB1Veto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_dtRechitClusterSizeBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_RPCMatch[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_RPCSpread0[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterEta_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEta_fullVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhi_fullVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterEtaPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); - - sprintf(name,"h_dtRechitClusterNStation_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterNWheel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterNWheel_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_HOMatchedEnergyCluster280Magnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOTime_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_HOTime_fullHOVeto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_muonPt_jetMB1Veto_%s_%s",mX[itr_mX],ctau); - h_muonPt_jetMB1Veto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonMB1Veto_%s_%s",mX[itr_mX],ctau); - h_jetPt_muonMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_MB1Rechits_jetMuonVeto_%s_%s",mX[itr_mX],ctau); - h_MB1Rechits_jetMuonVeto[itr_file] = new TH1D(name,"",200,0,200); - - sprintf(name,"h_muonPt_jetHOVeto_%s_%s",mX[itr_mX],ctau); - h_muonPt_jetHOVeto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonHOVeto_%s_%s",mX[itr_mX],ctau); - h_jetPt_muonHOVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOEnergy_jetMuonVeto_%s_%s",mX[itr_mX],ctau); - h_HOEnergy_jetMuonVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_muonDR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_muonDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_muonDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_muonDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_jetDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_jetDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_jetDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_muonDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); - h_muonDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); - h_muonDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_jetDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); - h_jetDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); - h_jetDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_decayVertexRadius_noVeto_%s_%s",mX[itr_mX],ctau); - h_decayVertexRadius_noVeto[itr_file] = new TH1D(name,"",80,0,800); - - sprintf(name,"h_HOEnergy_jetVeto_%s_%s",mX[itr_mX],ctau); - h_HOEnergy_jetVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_dRClusterRPC_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dRClusterRPC_jetVeto[itr_file] = new TH1D(name,"",30,0,3); - - sprintf(name,"h_dRClusterHO_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dRClusterHO_jetVeto[itr_file] = new TH1D(name,"",30,0,3); - - sprintf(name,"h_jetDR_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetDR_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetPt_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetEta_minDR_vetoJet[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetPhi_minDR_vetoJet[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetDR_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetDR_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPt_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetEta_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPhi_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_nWheels1_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels1_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels150_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels10_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels20_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels30_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_noCluster_%s_%s",mX[itr_mX],ctau); - h_nWheels50_noCluster[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels1_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels1_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels1_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels1_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels10_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels10_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels10_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels10_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels20_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels20_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels20_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels20_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels30_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels30_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels30_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels30_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels50_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels50_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels50_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels50_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_noVeto_%s_%s",mX[itr_mX],ctau); - h_nWheels150_noVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nWheels150_fullVetoPlus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_nWheels150_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_nWheels150_fullVetoMinus[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_jetPtMax_noVeto_%s_%s",mX[itr_mX],ctau); - h_jetPtMax_noVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVeto_%s_%s",mX[itr_mX],ctau); - h_jetPtMax_fullVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPtMax_fullVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMax_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_jetPtMax_fullVetoMinus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_noVeto_%s_%s",mX[itr_mX],ctau); - h_jetPtMET_noVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVeto_%s_%s",mX[itr_mX],ctau); - h_jetPtMET_fullVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPtMET_fullVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetPtMET_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_jetPtMET_fullVetoMinus[itr_file] = new TH1D(name,"",20,0,200); - - evtNum = 0; - totalNum = 0; - //weight = lumi*xSec*1000/treeReader.GetEntries(1); - totalEvents=0; - totalMagnetEvents=0; - totalBarrelEvents=0; - noEff=0.0; - muonEff=0.0; - jetEff=0.0; - MB1Eff=0.0; - HOEff=0.0; - fullEff=0.0; - fullHOEff=0.0; - - nPassMET=0; - nPassDTDecay=0; - nPassJetMET=0; - nPassJetMET_top4=0; - nPassJetMET_20=0; - nPassJetMET_30=0; - nPassJetMET_50=0; - nPassNoVeto=0; - nPassFullVeto=0; - - nPassMaxStation=0; - nPassDeltaPhi=0; - nPassRPCMatch=0; - nPassRPCSpread=0; - - nPassHODecay=0; - nPassNoVeto_ho=0; - nPassFullVeto_ho=0; - nPassDeltaPhi_ho=0; - nPassRPCMatch_ho=0; - nPassRPCSpread_ho=0; - - nPassMuon_std=0; - nPassMB1_std=0; - nPassMuon_alt=0; - nPassMB1_alt=0; - nPassJetMuon_std = 0; - nPassJetMB1_std = 0; - nPassFull_std = 0; - nPassFull_altMuon = 0; - nPassFull_altMB1 = 0; - nPassFull_altMuonMB1 = 0; - nPassFullDTPlus_noMuon = 0; - nPassFullDTPlus_noMB1 = 0; - nPassFullDTPlus_std = 0; - nPassFullDTPlus_altMuon = 0; - nPassFullDTPlus_altMB1 = 0; - nPassFullDTPlus_altMuonMB1 = 0; - - cout << mX[itr_mX] << "_" << ctau << endl; - for(Int_t itr_year = 0; itr_year<3; itr_year++){ - cout << " " << years[itr_year] << endl; - - TFile *_file; - if(strcmp(years[itr_year],"MC_Summer16")==0){ - _file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - //_file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - } - else{ - _file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - //_file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - - } - /*if(strcmp(mX[itr_mX],"450")==0){ - _file = TFile::Open(dir+"/signal_1000_"+mX[itr_mX]+"_"+ctau+".root"); - } - else{ - _file = TFile::Open(dir+"/signal_125_"+mX[itr_mX]+"_"+ctau+".root"); - } - - TTreeReader treeReader("ntuples/llp",_file); - */ - TTreeReader treeReader("MuonSystem",_file); - - TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); - //TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); - //TTreeReaderArray gLLP_pt(treeReader,"gLLP_pt"); - TTreeReaderArray gLLP_decay_vertex_x(treeReader,"gLLP_decay_vertex_x"); - TTreeReaderArray gLLP_decay_vertex_y(treeReader,"gLLP_decay_vertex_y"); - TTreeReaderArray gLLP_decay_vertex_z(treeReader,"gLLP_decay_vertex_z"); - //TTreeReaderArray gLLP_travel_time(treeReader,"gLLP_travel_time"); - - //TTreeReaderValue weight(treeReader,"weight"); - //TTreeReaderValue npv(treeReader,"npv"); - TTreeReaderValue MET(treeReader,"met"); - TTreeReaderValue METphi(treeReader,"metPhi"); - //TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); - - TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); - TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); - TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); - TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); - TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); - TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); - TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); - TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); - TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); - TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); - TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); - TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); - TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); - TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); - TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); - TTreeReaderArray dtRechitClusterNSegmentStation2(treeReader,"dtRechitClusterNSegmentStation2"); - TTreeReaderArray dtRechitClusterNSegmentStation3(treeReader,"dtRechitClusterNSegmentStation3"); - TTreeReaderArray dtRechitClusterNSegmentStation4(treeReader,"dtRechitClusterNSegmentStation4"); - TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); - TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); - TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); - TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - - TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); - TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); - TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); - TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); - TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); - TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); - TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); - TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - - TTreeReaderValue nJets(treeReader,"nJets"); - TTreeReaderArray jetPt(treeReader,"jetPt"); - TTreeReaderArray jetEta(treeReader,"jetEta"); - TTreeReaderArray jetPhi(treeReader,"jetPhi"); - /*TTreeReaderArray jetChargedEMEnergyFraction(treeReader,"jetChargedEMEnergyFraction"); - TTreeReaderArray jetNeutralEMEnergyFraction(treeReader,"jetNeutralEMEnergyFraction"); - TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); - TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); - */ - TTreeReaderValue nLeptons(treeReader,"nLeptons"); - TTreeReaderArray lepPassLooseIso(treeReader,"lepPassLooseIso"); - TTreeReaderValue nMuons(treeReader,"nMuons"); - TTreeReaderArray muonEta(treeReader,"muonEta"); - TTreeReaderArray muonPhi(treeReader,"muonPhi"); - TTreeReaderArray muonPt(treeReader,"muonPt"); - - TTreeReaderValue nRPCRechits(treeReader,"nRpc"); - TTreeReaderArray RPCRechitX(treeReader,"rpcX"); - TTreeReaderArray RPCRechitY(treeReader,"rpcY"); - TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); - TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); - TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); - - TTreeReaderValue nHORechits(treeReader,"nHORechits"); - TTreeReaderArray HORechitE(treeReader,"hoRechit_E"); - TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); - TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); - TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); - - totalNum += treeReader.GetEntries(1); - _ofile->cd(); - while(treeReader.Next()){ - fill_n(rechitCount, 5, 0); - hitWheels1 = 0; - hitWheels10 = 0; - hitWheels20 = 0; - hitWheels30 = 0; - hitWheels50 = 0; - hitWheels150 = 0; - goodEvt = false; - goodDecay = false; - magnetDecay = false; - clustSizeMax = 0.; - dPhi_min = -999.; - jetPt_tmp = 0.0; - dPhi_minTop4 = -999.; - dPhi_min20 = -999.; - dPhi_min30 = -999.; - dPhi_min50 = -999.; - if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } - - for(Int_t itr_llp=0; itr_llp<2; itr_llp++){ - if(gLLP_decay_vertex_z[itr_llp] < 650.){ - h_decayVertexRadius_noVeto[itr_file]->Fill(sqrt(pow(gLLP_decay_vertex_x[itr_llp],2)+pow(gLLP_decay_vertex_y[itr_llp],2))); - } - } - if(gLLP_dt[0] || gLLP_dt[1]){ goodDecay = true; } - else if(sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) > 300. && abs(gLLP_decay_vertex_z[0]) < 650.){ magnetDecay = true; } - else if(sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[1],2)) > 300. && abs(gLLP_decay_vertex_z[1]) < 650.){ magnetDecay = true; } - if(*MET > 200){ - //nPassMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - nPassMET += 1; - } - if(*MET > 200){ - //nPassDTDecay += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - nPassDTDecay += 1; - passNoVeto = false; - passFullVeto = false; - passRPCMatch = false; - passRPCSpread = false; - passMaxStation = false; - passDeltaPhi = false; - passFullVeto_ho = false; - passRPCMatch_ho = false; - passRPCSpread_ho = false; - passDeltaPhi_ho = false; - passMuonEvent_std=false; - passMB1Event_std=false; - passMuonEvent_alt=false; - passMB1Event_alt=false; - passJetMB1_std=false; - passJetMuon_std=false; - passFull_std = false; - passFull_altMuon = false; - passFull_altMB1 = false; - passFull_altMuonMB1 = false; - passFullDTPlus_noMuon = false; - passFullDTPlus_noMB1 = false; - passFullDTPlus_std = false; - passFullDTPlus_altMuon = false; - passFullDTPlus_altMB1 = false; - passFullDTPlus_altMuonMB1 = false; - passJetMET = false; - passJetMET_20 = false; - passJetMET_30 = false; - passJetMET_50 = false; - passJetMET_top4 = false; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - nPassFullPlus = 0; - nPassFullMinus = 0; - totalSumE=0.0; - totalBarrelEvents+=1; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - totalClusteredFullPlus = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - //h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); - if(*nJets>0){ - goodJets=0; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < fabs(dPhi_min)){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - if(goodJets<4){ dPhi_minTop4 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>50.0){ dPhi_min50 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>30.0){ dPhi_min30 = fabs(dPhi_tmp); } - if(jetPt[itr_jet]>20.0){ dPhi_min20 = fabs(dPhi_tmp); } - } - goodJets+=1; - //if(goodJets==4){ break; } - } - } - } - if(fabs(dPhi_minTop4)!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } - if(fabs(dPhi_min)>0.6){ passJetMET += true; } - if(fabs(dPhi_min20)>0.6){ passJetMET_20 += true; } - if(fabs(dPhi_min30)>0.6){ passJetMET_30 += true; } - if(fabs(dPhi_min50)>0.6){ passJetMET_50 += true; } - if(fabs(dPhi_minTop4)>0.6){ passJetMET_top4 += true; } - if(fabs(dPhi_minTop4)>0.0){ - //if(fabs(dPhiClusterMET_max)<1.0){ - //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - //nPassJetMET_top4 += 1; - h_MET[itr_file]->Fill(*MET); - h_jetPt[itr_file]->Fill(jetPt_tmp); - - if(*nDtRechits<1000){ - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - rechitWheel = getWheel(dtRechitZ[itr_dt]); - rechitWheel+=2; - if(rechitWheel>=0 && rechitWheel<5){ - rechitCount[rechitWheel] += 1; - } - } - } - else{ - fill_n(rechitCount, 5, 150); - } - for(Int_t itr_wheel = 0; itr_wheel<5; itr_wheel++){ - if(rechitCount[itr_wheel] > 0){ hitWheels1 += 1; } - if(rechitCount[itr_wheel] > 9){ hitWheels10 += 1; } - if(rechitCount[itr_wheel] > 19){ hitWheels20 += 1; } - if(rechitCount[itr_wheel] > 29){ hitWheels30 += 1; } - if(rechitCount[itr_wheel] > 49){ hitWheels50 += 1; } - if(rechitCount[itr_wheel] > 149){ hitWheels150 += 1; } - } - h_nWheels1_noCluster[itr_file]->Fill(hitWheels1); - h_nWheels10_noCluster[itr_file]->Fill(hitWheels10); - h_nWheels20_noCluster[itr_file]->Fill(hitWheels20); - h_nWheels30_noCluster[itr_file]->Fill(hitWheels30); - h_nWheels50_noCluster[itr_file]->Fill(hitWheels50); - h_nWheels150_noCluster[itr_file]->Fill(hitWheels150); - - if(*nDtRechitClusters > 0){ passNoVeto = true; } - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - fill_n(stationCount, 4, 0); - nStationUnclustered = 0; - nThreshStation = 0; - nThreshLowStation = 0; - nThreshStationUnclustered = 0; - nThreshLowStationUnclustered = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passMuon_alt = false; - passMB1_alt = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - /*passJet = true; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(jetPt[itr_jet]>20.){ - dPhi_tmp = RPCRechitPhi[itr_jet] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr_jet]-dtRechitClusterEta[itr_clust],2))<0.5){ - passJet = false; - break; - } - } - } - if(!passJet){ passInvertedJet = true; } - */ - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - passMB1_alt = true; - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ - passMB1_alt = false; - break; - } - } - } - passMuon_alt = true; - for(Int_t itr_lep = 0; itr_lep<*nLeptons; itr_lep++){ - if(lepPassLooseIso[itr_lep]){ - passMuon_alt = false; - break; - } - } - //if(*nLeptons==0){ passMuon_alt = true; } - - if(dtRechitClusterSize[itr_clust]>50){ - - nPassNone+=1; - noEff+=1.0; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(sumE>40.){ passHO = true; } - - muonPt_max = 0.0; - muonDR_min = 999.0; - for(Int_t itr=0; itr<*nMuons; itr++){ - dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(muonPt[itr]>muonPt_max){ - muonPt_max=muonPt[itr]; - } - } - if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(jetPt[itr]>jetPt_max){ - jetPt_max=jetPt[itr]; - } - } - if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))Fill(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))); - h_jetPt_minDR_vetoJet[itr_file]->Fill(jetPt[itr]); - h_jetEta_minDR_vetoJet[itr_file]->Fill(jetEta[itr]); - h_jetPhi_minDR_vetoJet[itr_file]->Fill(jetPhi[itr]); - //h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedEMEnergyFraction[itr]); - //h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralEMEnergyFraction[itr]); - //h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedHadronEnergyFraction[itr]); - //h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralHadronEnergyFraction[itr]); - } - } - - if(dtRechitClusterNSegmentStation2[itr_clust]>12){ nThreshStation+=1; } - if(dtRechitClusterNSegmentStation3[itr_clust]>12){ nThreshStation+=1; } - if(dtRechitClusterNSegmentStation4[itr_clust]>8){ nThreshStation+=1; } - - if(dtRechitClusterNSegmentStation2[itr_clust]>4){ nThreshLowStation+=1; } - if(dtRechitClusterNSegmentStation3[itr_clust]>4){ nThreshLowStation+=1; } - if(dtRechitClusterNSegmentStation4[itr_clust]>2){ nThreshLowStation+=1; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - - h_dtRechitClusterSize_noVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_noVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_noVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_noVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_noVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_noVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_noVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_noVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_noVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_noVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } - } - - if(passMuon){ - nPassMuon+=1; - muonEff+=1.0; - h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_muonVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_muonVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_muonVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_muonVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_muonVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_muonVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_muonVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_muonVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_muonVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } - } - } - - if(passJet){ - nPassJet+=1; - jetEff+=1.0; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_jetVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_jetVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_jetVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_jetVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_jetVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_jetVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_jetVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_jetVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_jetVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } - } - } - - if(passMB1){ - nPassMB1+=1; - MB1Eff+=1.0; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_MB1Veto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_MB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_MB1Veto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_MB1Veto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_MB1Veto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_MB1Veto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_MB1Veto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } - } - } - - if(passInvertedJet && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passInvertedMuon && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passInvertedJet && passInvertedMuon && passMB1){ - //cout << "inverted mu jet" << endl; - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - //cout << "done inverted" << endl; - - if(passMuon && passJet){ - //cout << "no MB1" << endl; - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file]->Fill(float(dtRechitClusterNSegmentStation1[itr_clust]) / dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNStation_noMB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_nRPCMatched_noMB1Veto[itr_file]->Fill(match); - h_MB1Rechits_jetMuonVeto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - if(!rpcLayer.empty()){ - h_RPCMatchedBxSpread_noMB1Veto[itr_file]->Fill(max_element(rpcBx.begin(),rpcBx.end()) - min_element(rpcBx.begin(),rpcBx.end())); - for(Int_t itr = 0; itrFill(matchLayer1); - h_nRPCMatchedLayer2_noMB1Veto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedLayer12_noMB1Veto[itr_file]->Fill(matchLayer1+matchLayer2); - } - //cout << "done no MB1" << endl; - - if(passMuon && passJet && passMB1){ - passFullVeto = true; - nPassFull+=1; - fullEff+=1.0; - - if(*nDtRechits<1000){ - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.5){ - rechitStation = getStation(dtRechitX[itr_dt],dtRechitY[itr_dt]); - if(rechitStation>-1){ - stationCount[rechitStation-1] += 1; - } - } - } - } - else{ - fill_n(stationCount, 4, 150); - } - for(Int_t itr_station=0; itr_station<4; itr_station++){ - if(stationCount[itr_station]>0){ nStationUnclustered+=1; } - if(itr_station<3){ - if(stationCount[itr_station]>12){ nThreshStationUnclustered+=1; } - if(stationCount[itr_station]>4){ nThreshLowStationUnclustered+=1; } - } - else{ - if(stationCount[itr_station]>8){ nThreshStationUnclustered+=1; } - if(stationCount[itr_station]>2){ nThreshLowStationUnclustered+=1; } - } - } - - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNStationUnclustered_fullVeto[itr_file]->Fill(nStationUnclustered); - h_dtRechitClusterNThreshStation_fullVeto[itr_file]->Fill(nThreshStation); - h_dtRechitClusterNThreshLowStation_fullVeto[itr_file]->Fill(nThreshLowStation); - h_dtRechitClusterNThreshStationUnclustered_fullVeto[itr_file]->Fill(nThreshStationUnclustered); - h_dtRechitClusterNThreshLowStationUnclustered_fullVeto[itr_file]->Fill(nThreshLowStationUnclustered); - h_dPhiClusterMET_fullVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_fullVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_fullVeto[itr_file]->Fill(match); - - h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); - h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - - h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); - - //h_gLLP_travel_time_fullVeto[itr_file]->Fill(gLLP_travel_time[llp_itr]); - //h_gLLPpt_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); - if(!rpcBx.empty()){ - rpcMean = accumulate(rpcBx.begin(), rpcBx.end(), 0.0) / rpcBx.size(); - //if(abs(rpcMean)<0.5){ h_gLLPpt_Bx0_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } - //else if(rpcMean < 1.5){ h_gLLPpt_Bx1_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } - } - - h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); - - if(!rpcBx.empty()){ - passRPCMatch = true; - h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_RPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread = true; - h_dtRechitClusterSize_RPCSpread0[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_RPCSpread0[itr_file]->Fill(jetDR_min); - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation = true; - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi = true; - nPassFullPlus+=1; - nPassFullMinus+=1; - totalClusteredFullPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterXSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); - h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - //h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); - } - } - } - } - - } - - if(passMuon && passJet){ - passJetMuon_std=true; - if(passMB1_alt){ - passFull_altMB1=true; - } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhiClusterMET)<1){ - passFullDTPlus_noMB1=true; - if(passMB1_alt){ - passFullDTPlus_altMB1=true; - } - } - } - if(passMB1 && passJet){ - passJetMB1_std=true; - if(passMuon_alt){ - passFull_altMuon=true; - } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2 && fabs(dPhiClusterMET)<1){ - passFullDTPlus_noMuon=true; - if(passMuon_alt){ - passFullDTPlus_altMuon=true; - } - } - } - if(passMuon_alt){ - passMuonEvent_alt=true; - if(passJet && passMB1_alt){ - passFull_altMuonMB1=true; - if(!rpcBx.empty()){ - if(rpcSpread==0){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhiClusterMET)<1){ - passFullDTPlus_altMuonMB1=true; - } - } - } - } - } - } - if(passMB1_alt){ - passMB1Event_alt=true; - } - if(passMuon){ - passMuonEvent_std=true; - } - if(passMB1){ - passMB1Event_std=true; - if(passJet && passMuon){ - passFull_std=true; - if(!rpcBx.empty()){ - if(rpcSpread==0){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhiClusterMET)<1){ - passFullDTPlus_std=true; - } - } - } - } - } - } - - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeBarrel_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - /*if(passMuon && passJet && passHO){ - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - }*/ - - if(passMuon && passMB1){ - h_jetPt_muonMB1Veto[itr_file]->Fill(jetPt_max); - } - - if(passJet && passMB1){ - h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); - } - if(passJet && passMuon && passHO){ - passFullVeto_ho = true; - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); - h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); - h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - - h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); - - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - passRPCMatch_ho = true; - h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread_ho = true; - h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi_ho = true; - totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); - h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); - h_jetEta_minDR_fullHOVetoPlus[itr_file]->Fill(jetEta[jetDR_index]); - h_jetPhi_minDR_fullHOVetoPlus[itr_file]->Fill(jetPhi[jetDR_index]); - //h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); - //h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); - //h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); - //h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); - } - } - } - } - } - } - if(passFullVeto_ho){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch_ho){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread_ho){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi_ho){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - if(passNoVeto){ nPassNoVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passFullVeto){ nPassFullVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch){ nPassRPCMatch += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread){ nPassRPCSpread += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passMaxStation){ nPassMaxStation += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi){ nPassDeltaPhi += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - if(passJetMuon_std){ nPassJetMuon_std += 1; } - if(passJetMB1_std){ nPassJetMB1_std += 1; } - if(passMuonEvent_std){ nPassMuon_std += 1; } - if(passMB1Event_std){ nPassMB1_std += 1; } - if(passMuonEvent_alt){ nPassMuon_alt += 1; } - if(passMB1Event_alt){ nPassMB1_alt += 1; } - if(passFull_std){ nPassFull_std += 1; } - if(passFull_altMuon){ nPassFull_altMuon += 1; } - if(passFull_altMB1){ nPassFull_altMB1 += 1; } - if(passFull_altMuonMB1){ nPassFull_altMuonMB1 += 1; } - if(passFullDTPlus_noMuon){ nPassFullDTPlus_noMuon += 1; } - if(passFullDTPlus_noMB1){ nPassFullDTPlus_noMB1 += 1; } - if(passFullDTPlus_std){ - nPassFullDTPlus_std += 1; - if(passJetMET){ nPassJetMET += 1; } - if(passJetMET_20){ nPassJetMET_20 += 1; } - if(passJetMET_30){ nPassJetMET_30 += 1; } - if(passJetMET_50){ nPassJetMET_50 += 1; } - if(passJetMET_top4){ nPassJetMET_top4 += 1; } - } - if(passFullDTPlus_altMuon){ nPassFullDTPlus_altMuon += 1; } - if(passFullDTPlus_altMB1){ nPassFullDTPlus_altMB1 += 1; } - if(passFullDTPlus_altMuonMB1){ nPassFullDTPlus_altMuonMB1 += 1; } - - h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); - h_nDtRechitClusters_muonVeto[itr_file]->Fill(nPassMuon); - h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); - h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); - h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); - - if(nPassNone>0){ - h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); - h_nWheels1_noVeto[itr_file]->Fill(hitWheels1); - h_nWheels10_noVeto[itr_file]->Fill(hitWheels10); - h_nWheels20_noVeto[itr_file]->Fill(hitWheels20); - h_nWheels30_noVeto[itr_file]->Fill(hitWheels30); - h_nWheels50_noVeto[itr_file]->Fill(hitWheels50); - h_nWheels150_noVeto[itr_file]->Fill(hitWheels150); - h_jetPtMET_noVeto[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_noVeto[itr_file]->Fill(jetPt[0]); - } - if(nPassMuon>0){ h_dPhiJetMETBarrel_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETBarrel_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETBarrel_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETBarrel_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ - h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); - h_jetPtMET_fullVeto[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVeto[itr_file]->Fill(jetPt[0]); - } - if(nPassFullPlus>0){ - h_nWheels1_fullVetoPlus[itr_file]->Fill(hitWheels1); - h_nWheels10_fullVetoPlus[itr_file]->Fill(hitWheels10); - h_nWheels20_fullVetoPlus[itr_file]->Fill(hitWheels20); - h_nWheels30_fullVetoPlus[itr_file]->Fill(hitWheels30); - h_nWheels50_fullVetoPlus[itr_file]->Fill(hitWheels50); - h_nWheels150_fullVetoPlus[itr_file]->Fill(hitWheels150); - h_jetPtMET_fullVetoPlus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoPlus[itr_file]->Fill(jetPt[0]); - } - if(nPassFullMinus>0){ - h_nWheels1_fullVetoMinus[itr_file]->Fill(hitWheels1); - h_nWheels10_fullVetoMinus[itr_file]->Fill(hitWheels10); - h_nWheels20_fullVetoMinus[itr_file]->Fill(hitWheels20); - h_nWheels30_fullVetoMinus[itr_file]->Fill(hitWheels30); - h_nWheels50_fullVetoMinus[itr_file]->Fill(hitWheels50); - h_nWheels150_fullVetoMinus[itr_file]->Fill(hitWheels150); - h_jetPtMET_fullVetoMinus[itr_file]->Fill(jetPt_tmp); - h_jetPtMax_fullVetoMinus[itr_file]->Fill(jetPt[0]); - } - //h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); - //h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); - h_nTotalClusteredRechitsBarrel_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsBarrel_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsBarrel_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsBarrel_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - - h_dPhiClusterMETMax[itr_file]->Fill(dPhiClusterMET_max); - - h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); - } - } - - /*if(*MET>200 && magnetDecay){ - nPassHODecay+=1; - totalMagnetEvents+=1; - passNoVeto = false; - passFullVeto = false; - passRPCMatch = false; - passRPCSpread = false; - passMaxStation = false; - passDeltaPhi = false; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - goodJets=0; - totalSumE=0.0; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - totalClusteredFullHOPlus = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - } - goodJets+=1; - if(goodJets==4){ break; } - } - } - h_dPhiJetMETMagnet[itr_file]->Fill(fabs(dPhi_min)); - if(fabs(dPhi_min)>0.6){ - //if(fabs(dPhiClusterMET_max)<1.0){ - nPassJetMET+=1; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - passNoVeto = true; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - if(!rpcLayer.empty()){ - for(Int_t itr = 0; itr TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(passJet){ - h_dRClusterHO_jetVeto[itr_file]->Fill(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))); - } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(passJet){ - h_HOEnergy_jetVeto[itr_file]->Fill(sumE); - } - if(sumE>40.){ passHO = true; } - - muonPt_max = 0.0; - muonDR_min = 999.0; - for(Int_t itr=0; itr<*nMuons; itr++){ - dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(muonPt[itr]>muonPt_max){ - muonPt_max=muonPt[itr]; - } - } - if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(jetPt[itr]>jetPt_max){ - jetPt_max=jetPt[itr]; - } - } - if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))50){ - - nPassNone+=1; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - if(passMuon){ - nPassMuon+=1; - } - if(passJet){ - nPassJet+=1; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_nRPCMatchedMagnet_jetVeto[itr_file]->Fill(match); - - h_nRPCMatchedMagnetLayer1_jetVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_jetVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_jetVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_jetVeto[itr_file]->Fill(matchLayer4); - } - if(passMB1){ - nPassMB1+=1; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon){ - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_HOEnergy_jetMuonVeto[itr_file]->Fill(sumE); - if(dtRechitClusterSize[itr_clust]>=280){ - totalSumE+=sumE; - } - } - if(passJet && passHO){ - h_muonPt_jetHOVeto[itr_file]->Fill(muonPt_max); - } - if(passMuon && passHO){ - h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); - } - if(passJet && passMuon && passMB1){ - nPassFull+=1; - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passHO){ - passFullVeto = true; - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); - h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); - h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - - h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); - - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - passRPCMatch = true; - h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread = true; - h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi = true; - totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - } - } - } - } - } - } - h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file]->Fill(totalSumE); - - if(passNoVeto){ nPassNoVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passFullVeto){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - if(nPassNone>0){ h_dPhiJetMETMagnet_noVeto[itr_file]->Fill(dPhi_min); } - if(nPassMuon>0){ h_dPhiJetMETMagnet_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETMagnet_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETMagnet_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETMagnet_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ h_dPhiJetMETMagnet_fullVeto[itr_file]->Fill(dPhi_min); } - if(nPassFullHO>0){ h_dPhiJetMETMagnet_fullHOVeto[itr_file]->Fill(dPhi_min); } - - h_nTotalClusteredRechitsMagnet_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsMagnet_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsMagnet_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsMagnet_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); - } - }*/ - /*if(*MET>200){ - totalEvents+=1; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - goodJets=0; - totalSumE=0.0; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - } - goodJets+=1; - if(goodJets==4){ break; } - } - } - if(fabs(dPhi_min)>0.6){ - //if(fabs(dPhiClusterMET_max)<1.0){ - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(sumE>40.){ passHO = true; } - - if(dtRechitClusterSize[itr_clust]>50){ - - nPassNone+=1; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - if(passMuon){ - nPassMuon+=1; - } - if(passJet){ - nPassJet+=1; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passMB1){ - nPassMB1+=1; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon){ - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passMB1){ - nPassFull+=1; - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passHO){ - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - } - } - if(nPassNone>0){ h_dPhiJetMETAll_noVeto[itr_file]->Fill(dPhi_min); } - if(nPassMuon>0){ h_dPhiJetMETAll_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETAll_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETAll_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETAll_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ h_dPhiJetMETAll_fullVeto[itr_file]->Fill(dPhi_min); } - - h_nTotalClusteredRechitsAll_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsAll_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsAll_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsAll_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsAll_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsAll_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsAll_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - } - }*/ - evtNum+=1; - } - - } - //cout << "Total events = " << totalEvents << endl; - //cout << "Total magnet events = " << totalMagnetEvents << endl; - //cout << "Total barrel events = " << totalBarrelEvents << endl; - - cout << "MET > 200: " << nPassMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - //cout << "DT Decay: " << nPassDTDecay * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet [20 GeV],MET) > 0.6: " << nPassJetMET_20 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet [30 GeV],MET) > 0.6: " << nPassJetMET_30 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet [50 GeV],MET) > 0.6: " << nPassJetMET_50 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet [Top 4],MET) > 0.6: " << nPassJetMET_top4 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "No Veto: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full Veto: " << nPassFullVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Max Station > 2: " << nPassMaxStation * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - //cout << "HO Decay: " << nPassHODecay * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "No Veto: " << nPassNoVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full Veto: " << nPassFullVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "DT cluster: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - cout << "Muon veto: " << nPassMuon_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "MB1 veto: " << nPassMB1_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Jet+Muon veto: " << nPassJetMuon_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Jet+MB1 veto: " << nPassJetMB1_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full DT Veto: " << nPassFull_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - cout << "Alt Muon veto: " << nPassMuon_alt * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt MB1 veto: " << nPassMB1_alt * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt Muon Full DT veto: " << nPassFull_altMuon * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt MB1 Full DT veto: " << nPassFull_altMB1 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt Muon MB1 Full DT veto: " << nPassFull_altMuonMB1 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - cout << "Full DT Selection No Muon: " << nPassFullDTPlus_noMuon * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full DT Selection No MB1: " << nPassFullDTPlus_noMB1 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full DT Selection: " << nPassFullDTPlus_std * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt Muon Full DT Selection: " << nPassFullDTPlus_altMuon * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt MB1 Full DT Selection: " << nPassFullDTPlus_altMB1 * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Alt Muon MB1 Full DT Selection: " << nPassFullDTPlus_altMuonMB1 * 137.0 * 1000. * 48.58 * 0.01 << endl; - - cout << " " << endl; - - itr_file+=1; - } - - _ofile->Write(); - _ofile->Close(); - -} diff --git a/analyzeSignal_SD.C b/analyzeSignal_SD.C deleted file mode 100644 index 8bb29cc..0000000 --- a/analyzeSignal_SD.C +++ /dev/null @@ -1,2309 +0,0 @@ -R__LOAD_LIBRARY(libTreePlayer) - -int getStation(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 400. && hitR < 480.){ return 1; } - else if(hitR > 485. && hitR < 560.){ return 2; } - else if(hitR > 590. && hitR < 650.){ return 3; } - else if(hitR > 690. && hitR < 800.){ return 4; } - else{ return -1; } -} - -int getWheel(float hitZ){ - if(hitZ > 0){ - if(hitZ < 127.){ return 0; } - else if(hitZ < 395.){ return 1; } - else if(hitZ < 661.){ return 2; } - else{ return -99; } - } - else{ - return -1*getWheel(-1.0*hitZ); - } -} - -int getRPCLayer(float hitX, float hitY){ - float hitR = sqrt(pow(hitX,2)+pow(hitY,2)); - if(hitR > 410. && hitR < 440.){ return 1; } - else if(hitR > 445. && hitR < 475.){ return 2; } - else if(hitR > 490. && hitR < 520.){ return 3; } - else if(hitR > 525. && hitR < 555.){ return 4; } - else if(hitR > 600. && hitR < 630.){ return 5; } - else if(hitR > 700. && hitR < 770.){ return 6; } - else{ return -1; } -} - -void analyzeSignal(){ - - const bool useHDFS(false); - const bool useCERN(false); - TString fsPreFix; - if (useHDFS) { - fsPreFix = "/mnt/hadoop"; - } - else { - fsPreFix = "root://cmsxrootd.fnal.gov/"; - if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; - } - - char name[50]; - char title[100]; - char mX[3][10] = {"15","40","55"}; - //char mX[2][10] = {"25","450"}; - //char ctau[10] = "1m"; - char ctau[10] = "10000"; - char years[3][10] = {"2018","2017","2016"}; - char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; - char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); - for(Int_t itr_year=0; itr_year < 3; itr_year++){ - TFile *_file; - _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_" + - runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); - - //TString dir("/storage/user/mcitron/signalPointsGGHWithRPCWithFlags/"); - //TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); - // TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p15/"); - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); - - - /* - data files - TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/"); - - 2016 data for ex: /mnt/hadoop/store/group/phys_exotica/delayedjets/disp -lacedJetMuonAnalyzer/driftTube/V1p17/Data2016/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root - - - */ - TFile *_ofile = TFile::Open("outSig_central_V1p17.root","RECREATE"); - Float_t lumi[3] = {37.8,44.98,63.67}; - Float_t xSec = 48.58; - Float_t weight; - - TH1D *h_dPhiClusterMET[4]; - TH1D *h_dPhiClusterMETMax[4]; - TH1D *h_dPhiJetMET[4]; - TH1D *h_jetMet_dPhiMin4[4]; - TH1D *h_MET[4]; - TH1D *h_jetPt[4]; - - TH1D *h_dPhiJetMETBarrel_noVeto[4]; - TH1D *h_dPhiJetMETBarrel_jetVeto[4]; - TH1D *h_dPhiJetMETBarrel_muonVeto[4]; - TH1D *h_dPhiJetMETBarrel_MB1Veto[4]; - TH1D *h_dPhiJetMETBarrel_noMB1Veto[4]; - TH1D *h_dPhiJetMETBarrel_fullVeto[4]; - TH1D *h_dPhiJetMETMagnet_noVeto[4]; - TH1D *h_dPhiJetMETMagnet_jetVeto[4]; - TH1D *h_dPhiJetMETMagnet_muonVeto[4]; - TH1D *h_dPhiJetMETMagnet_MB1Veto[4]; - TH1D *h_dPhiJetMETMagnet_noMB1Veto[4]; - TH1D *h_dPhiJetMETMagnet_fullVeto[4]; - TH1D *h_dPhiJetMETMagnet_fullHOVeto[4]; - TH1D *h_dPhiJetMETMagnet[4]; - TH1D *h_dPhiJetMETAll_noVeto[4]; - TH1D *h_dPhiJetMETAll_jetVeto[4]; - TH1D *h_dPhiJetMETAll_muonVeto[4]; - TH1D *h_dPhiJetMETAll_MB1Veto[4]; - TH1D *h_dPhiJetMETAll_noMB1Veto[4]; - TH1D *h_dPhiJetMETAll_fullVeto[4]; - - TH1D *h_nDtRechitClusters_noVeto[4]; - TH1D *h_dtRechitClusterSize_noVeto[4]; - TH1D *h_nTotalClusteredRechits_noVeto[4]; - TH1D *h_dtRechitClusterMaxStation_noVeto[4]; - TH1D *h_dtRechitClusterNStation_noVeto[4]; - TH1D *h_dPhiClusterMET_noVeto[4]; - TH1D *h_dtRechitClusterXSpread_noVeto[4]; - TH1D *h_dtRechitClusterYSpread_noVeto[4]; - TH1D *h_dtRechitClusterZSpread_noVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_noVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_noVeto[4]; - TH1D *h_nRPCMatched_noVeto[4]; - TH1D *h_RPCMatchedBx_noVeto[4]; - TH1D *h_RPCMatchedBxSpread_noVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_noVeto[4]; - TH1D *h_nRPCMatched_Spread0_noVeto[4]; - TH2D *h_npv_nDtRechitClusters_noVeto[4]; - - TH1D *h_nDtRechitClusters_muonVeto[4]; - TH1D *h_dtRechitClusterSize_muonVeto[4]; - TH1D *h_nTotalClusteredRechits_muonVeto[4]; - TH1D *h_dtRechitClusterMaxStation_muonVeto[4]; - TH1D *h_dtRechitClusterNStation_muonVeto[4]; - TH1D *h_dPhiClusterMET_muonVeto[4]; - TH1D *h_dtRechitClusterXSpread_muonVeto[4]; - TH1D *h_dtRechitClusterYSpread_muonVeto[4]; - TH1D *h_dtRechitClusterZSpread_muonVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_muonVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_muonVeto[4]; - TH1D *h_nRPCMatched_muonVeto[4]; - TH1D *h_RPCMatchedBx_muonVeto[4]; - TH1D *h_RPCMatchedBxSpread_muonVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_muonVeto[4]; - TH1D *h_nRPCMatched_Spread0_muonVeto[4]; - - TH1D *h_nDtRechitClusters_jetVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_jetVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_jetVeto[4]; - TH1D *h_dtRechitClusterSizeAll_jetVeto[4]; - TH1D *h_dtRechitClusterSize_jetVeto[4]; - TH1D *h_nTotalClusteredRechits_jetVeto[4]; - TH1D *h_dtRechitClusterMaxStation_jetVeto[4]; - TH1D *h_dtRechitClusterNStation_jetVeto[4]; - TH1D *h_dPhiClusterMET_jetVeto[4]; - TH1D *h_dtRechitClusterXSpread_jetVeto[4]; - TH1D *h_dtRechitClusterYSpread_jetVeto[4]; - TH1D *h_dtRechitClusterZSpread_jetVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_jetVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_jetVeto[4]; - TH1D *h_nRPCMatched_jetVeto[4]; - TH1D *h_nRPCMatchedMagnet_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer1_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer2_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer3_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer4_jetVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer1_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer2_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer3_fullHOVeto[4]; - TH1D *h_nRPCMatchedMagnetLayer4_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_jetVeto[4]; - TH1D *h_RPCMatchedBxSpread_jetVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_jetVeto[4]; - TH1D *h_nRPCMatched_Spread0_jetVeto[4]; - - TH1D *h_nDtRechitClusters_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeBarrel_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeMagnet_MB1Veto[4]; - TH1D *h_dtRechitClusterSizeAll_MB1Veto[4]; - TH1D *h_dtRechitClusterSize_MB1Veto[4]; - TH1D *h_nTotalClusteredRechits_MB1Veto[4]; - TH1D *h_dtRechitClusterMaxStation_MB1Veto[4]; - TH1D *h_dtRechitClusterNStation_MB1Veto[4]; - TH1D *h_dPhiClusterMET_MB1Veto[4]; - TH1D *h_dtRechitClusterXSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterYSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterZSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterEtaSpread_MB1Veto[4]; - TH1D *h_dtRechitClusterPhiSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_MB1Veto[4]; - TH1D *h_RPCMatchedBx_MB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_MB1Veto[4]; - TH1D *h_nRPCMatched_Spread0_MB1Veto[4]; - TH1D *h_RPCMatchedBx_Spread0_MB1Veto[4]; - - TH1D *h_nDtRechitClusters_fullVeto[4]; - TH1D *h_dtRechitClusterSizeBarrel_fullVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_fullVeto[4]; - TH1D *h_dtRechitClusterSizeAll_fullVeto[4]; - TH1D *h_dtRechitClusterSize_fullVeto[4]; - TH1D *h_nTotalClusteredRechits_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullVeto[4]; - TH1D *h_dtRechitClusterMaxStation_fullHOVeto[4]; - TH1D *h_dtRechitClusterNStation_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullVeto[4]; - TH1D *h_dPhiClusterMET_fullHOVeto[4]; - TH1D *h_dtRechitClusterXSpread_fullVeto[4]; - TH1D *h_dtRechitClusterYSpread_fullVeto[4]; - TH1D *h_dtRechitClusterZSpread_fullVeto[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVeto[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVeto[4]; - TH1D *h_nRPCMatched_fullVeto[4]; - TH1D *h_nRPCMatched_fullHOVeto[4]; - TH1D *h_RPCMatchedBx_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullVeto[4]; - TH1D *h_RPCMatchedBxSpread_fullHOVeto[4]; - TH1D *h_nRPCMatched_Spread0_fullVeto[4]; - TH1D *h_RPCMatchedBx_Spread0_fullVeto[4]; - - TH1D *h_dtRechitClusterEta_fullVeto[4]; - TH1D *h_dtRechitClusterPhi_fullVeto[4]; - TH1D *h_dtRechitClusterR_fullVeto[4]; - TH1D *h_dtRechitClusterZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZ_fullVeto[4]; - TH2D *h_dtRechitClusterRZFine_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels50_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels25_fullVeto[4]; - TH1D *h_dtRechitClusterNWheels1_fullVeto[4]; - TH1D *h_dtRechitClusterMaxWheel_fullVeto[4]; - TH2D *h_npv_nDtRechitClusters_fullVeto[4]; - TH1D *h_gLLPpt_fullVeto[4]; - TH1D *h_gLLPpt_Bx0_fullVeto[4]; - TH1D *h_gLLPpt_Bx1_fullVeto[4]; - TH1D *h_gLLP_travel_time_fullVeto[4]; - - TH1D *h_RPCMatchedBx_invertedJetVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuonVeto[4]; - TH1D *h_RPCMatchedBx_invertedMuJetVeto[4]; - - TH1D *h_dtRechitClusterSize_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeBarrel_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeMagnet_noMB1Veto[4]; - TH1D *h_dtRechitClusterSizeAll_noMB1Veto[4]; - TH1D *h_dtRechitClusterNStation_noMB1Veto[4]; - TH1D *h_dtRechitClusterNRechitsMB1_noMB1Veto[4]; - TH1D *h_dtRechitClusterPercentRechitsMB1_noMB1Veto[4]; - TH1D *h_nRPCMatched_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer1_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer2_noMB1Veto[4]; - TH1D *h_nRPCMatchedLayer12_noMB1Veto[4]; - TH1D *h_RPCMatchedBxSpread_noMB1Veto[4]; - - TH1D *h_dtRechitClusterSizeBarrel_HOVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_HOVeto[4]; - TH1D *h_dtRechitClusterSizeAll_HOVeto[4]; - - TH1D *h_dtRechitClusterSizeBarrel_fullHOVeto[4]; - TH1D *h_dtRechitClusterSizeMagnet_fullHOVeto[4]; - TH1D *h_dtRechitClusterSizeAll_fullHOVeto[4]; - - TH1D *h_nTotalClusteredRechitsBarrel_noVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_noVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_noVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_jetVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsAll_MB1Veto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsAll_noMB1Veto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_HOVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_fullVeto[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullHOVeto[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullHOVeto[4]; - TH1D *h_nTotalClusteredRechitsAll_fullHOVeto[4]; - - TH1D *h_dtRechitClusterSize_RPCMatch[4]; - TH1D *h_dtRechitClusterSize_RPCSpread0[4]; - TH1D *h_nTotalClusteredRechits_fullVetoPlus[4]; - TH1D *h_nTotalClusteredRechitsBarrel_fullVetoPlus[4]; - TH1D *h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterXSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterYSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterZSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEtaSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhiSpread_fullVetoPlus[4]; - TH1D *h_dtRechitClusterEta_fullVetoPlus[4]; - TH1D *h_dtRechitClusterPhi_fullVetoPlus[4]; - TH2D *h_dtRechitClusterEtaPhi_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoPlus[4]; - TH1D *h_dtRechitClusterSizeRatio_fullVetoMinus[4]; - TH1D *h_dtRechitClusterNWheel_fullVetoPlus[4]; - TH1D *h_dtRechitClusterNStation_fullHOVetoPlus[4]; - TH1D *h_dtRechitClusterNWheel_fullHOVetoPlus[4]; - - TH1D *h_HOMatchedEnergyCluster280Magnet_noMB1Veto[4]; - - TH1D *h_HOTime_fullHOVeto[4]; - - TH1D *h_muonPt_jetMB1Veto[4]; - TH1D *h_jetPt_muonMB1Veto[4]; - TH1D *h_MB1Rechits_jetMuonVeto[4]; - TH1D *h_muonPt_jetHOVeto[4]; - TH1D *h_jetPt_muonHOVeto[4]; - TH1D *h_HOEnergy_jetMuonVeto[4]; - - TH1D *h_muonDR_fullVeto[4]; - TH1D *h_muonDR_RPCMatch[4]; - TH1D *h_muonDR_RPCSpread0[4]; - TH1D *h_jetDR_fullVeto[4]; - TH1D *h_jetDR_RPCMatch[4]; - TH1D *h_jetDR_RPCSpread0[4]; - TH1D *h_muonDR_fullHOVeto[4]; - TH1D *h_muonDR_HORPCMatch[4]; - TH1D *h_muonDR_HORPCSpread0[4]; - TH1D *h_jetDR_fullHOVeto[4]; - TH1D *h_jetDR_HORPCMatch[4]; - TH1D *h_jetDR_HORPCSpread0[4]; - - TH1D *h_decayVertexRadius_noVeto[4]; - TH1D *h_HOEnergy_jetVeto[4]; - TH1D *h_dRClusterRPC_jetVeto[4]; - TH1D *h_dRClusterHO_jetVeto[4]; - - TH1D *h_jetDR_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPt_minDR_fullHOVetoPlus[4]; - TH1D *h_jetEta_minDR_fullHOVetoPlus[4]; - TH1D *h_jetPhi_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[4]; - TH1D *h_jetDR_minDR_vetoJet[4]; - TH1D *h_jetPt_minDR_vetoJet[4]; - TH1D *h_jetEta_minDR_vetoJet[4]; - TH1D *h_jetPhi_minDR_vetoJet[4]; - TH1D *h_jetChargedEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralEMEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetNeutralHadronEnergyFraction_minDR_vetoJet[4]; - TH1D *h_jetChargedHadronEnergyFraction_minDR_vetoJet[4]; - - Double_t dPhi_tmp = 0.0; - Double_t dPhiClusterMET = 0.0; - Double_t dPhiClusterMET_max = 0.0; - Double_t dPhi_min = 999.; - Double_t clustSizeMax = 0.; - Double_t dPhi_clust = 999.; - Double_t jetPt_tmp = 0.0; - Double_t muonPt_max = 0.0; - Double_t muonDR_min = 0.0; - Double_t jetPt_max = 0.0; - Double_t jetDR_min = 0.0; - Int_t jetDR_index = -1; - - vector muStatus = {}; - Double_t dR_tmp = 0.0; - Int_t nMatched = 0; - vector goodStatus = {1,44,51,52,91}; - vector rpcBx = {}; - vector rpcLayer = {}; - vector zWheel = {}; - Int_t rpcSpread = 0; - Float_t rpcMean = 0; - - Int_t evtNum = 0; - Int_t totalNum = 0; - Bool_t goodEvt = false; - Int_t itr_file = 0; - Int_t goodJets = 0; - Bool_t matchJet = false; - Bool_t matchMuon = false; - Int_t match = 0; - Int_t matchLayer1 = 0; - Int_t matchLayer2 = 0; - Int_t matchLayer3 = 0; - Int_t matchLayer4 = 0; - Int_t matchHO = 0; - Float_t sumE = 0.0; - Float_t totalSumE = 0.0; - Float_t weightT = 0.0; - Int_t llp_itr = -1; - - Bool_t passMuon = false; - Bool_t passJet = false; - Bool_t passMB1 = false; - Bool_t passHO = false; - Bool_t passInvertedJet = false; - Bool_t passInvertedMuon = false; - Bool_t passInvertedMuJet = false; - Int_t nPassMuon = 0; - Int_t nPassJet = 0; - Int_t nPassJetMuon = 0; - Int_t nPassMB1 = 0; - Int_t nPassHO = 0; - Int_t nPassFull = 0; - Int_t nPassFullHO = 0; - Int_t nPassNone = 0; - Int_t totalBarrelEvents = 0; - Int_t totalMagnetEvents = 0; - Int_t totalEvents = 0; - Int_t totalClusteredNone = 0; - Int_t totalClusteredNoMB1 = 0; - Int_t totalClusteredJet = 0; - Int_t totalClusteredMB1 = 0; - Int_t totalClusteredHO = 0; - Int_t totalClusteredFull = 0; - Int_t totalClusteredFullHO = 0; - Float_t noEff = 0.0; - Float_t muonEff = 0.0; - Float_t jetEff = 0.0; - Float_t MB1Eff = 0.0; - Float_t HOEff = 0.0; - Float_t fullHOEff = 0.0; - Float_t fullEff = 0.0; - - Bool_t goodDecay = false; - Bool_t magnetDecay = false; - - Bool_t passNoVeto = false; - Bool_t passFullVeto = false; - Bool_t passRPCMatch = false; - Bool_t passRPCSpread = false; - Bool_t passMaxStation = false; - Bool_t passDeltaPhi = false; - Bool_t passFullVeto_ho = false; - Bool_t passRPCMatch_ho = false; - Bool_t passRPCSpread_ho = false; - Bool_t passMaxStation_ho = false; - Bool_t passDeltaPhi_ho = false; - - Float_t nPassMET = 0; - Float_t nPassDTDecay = 0; - Float_t nPassJetMET = 0; - Float_t nPassNoVeto = 0; - Float_t nPassFullVeto = 0; - - Float_t nPassMaxStation = 0; - Float_t nPassDeltaPhi = 0; - Float_t nPassRPCMatch = 0; - Float_t nPassRPCSpread = 0; - - Float_t nPassHODecay = 0; - Float_t nPassNoVeto_ho = 0; - Float_t nPassFullVeto_ho = 0; - Float_t nPassRPCMatch_ho = 0; - Float_t nPassRPCSpread_ho = 0; - Float_t nPassDeltaPhi_ho = 0; - - Int_t totalClusteredFullPlus = 0; - Int_t totalClusteredFullHOPlus = 0; - - cout << "Preparing histograms" << endl; - for(Int_t itr_mX=0; itr_mX<3; itr_mX++){ - sprintf(name,"h_jetMet_dPhiMin4_%s_%s",mX[itr_mX],ctau); - h_jetMet_dPhiMin4[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMET_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMET[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETBarrel_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETMagnet_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETMagnet[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_noMB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiJetMETAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiJetMETAll_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMET_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMETMax_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMETMax[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_MET_%s_%s",mX[itr_mX],ctau); - h_MET[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_jetPt_%s_%s",mX[itr_mX],ctau); - h_jetPt[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nDtRechitClusters_noVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_noVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_noVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_noVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_noVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_noVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_noVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_noVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_noVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_noVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_noVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSize_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_muonVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_muonVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_muonVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_muonVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_muonVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_muonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_muonVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_muonVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_jetVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_jetVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_jetVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_jetVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnet_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer1_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer1_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer2_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer2_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer3_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer3_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer4_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer4_jetVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer1_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer2_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer3_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_nRPCMatchedMagnetLayer4_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file] = new TH1D(name,"",30,0,30); - - sprintf(name,"h_RPCMatchedBxSpread_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_jetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_jetVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_dtRechitClusterSizeBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nDtRechitClusters_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_MB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_MB1Veto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_MB1Veto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBx_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_MB1Veto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_MB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nDtRechitClusters_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechits_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechits_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterMaxStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterMaxStation_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullVeto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dPhiClusterMET_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_fullVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dPhiClusterMET_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dPhiClusterMET_fullHOVeto[itr_file] = new TH1D(name,"",70,0,3.5); - - sprintf(name,"h_dtRechitClusterXSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_fullVeto[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_fullVeto[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_RPCMatchedBx_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatched_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_fullHOVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_fullVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBxSpread_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_fullHOVeto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_RPCMatchedBx_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_Spread0_fullVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_nRPCMatched_Spread0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_Spread0_fullVeto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_dtRechitClusterEta_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEta_fullVeto[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhi_fullVeto[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterR_fullVeto[itr_file] = new TH1D(name,"",40,0,800); - - sprintf(name,"h_dtRechitClusterZ_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZ_fullVeto[itr_file] = new TH1D(name,"",120,-600,600); - - sprintf(name,"h_dtRechitClusterRZ_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterRZ_fullVeto[itr_file] = new TH2D(name,"",120,-600,600,40,400,800); - - sprintf(name,"h_dtRechitClusterRZFine_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterRZFine_fullVeto[itr_file] = new TH2D(name,"",1200,-600,600,400,400,800); - - sprintf(name,"h_dtRechitClusterNWheels50_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels50_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels25_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels25_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterNWheels1_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheels1_fullVeto[itr_file] = new TH1D(name,"",6,0,6); - - sprintf(name,"h_dtRechitClusterMaxWheel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterMaxWheel_fullVeto[itr_file] = new TH1D(name,"",6,-3,3); - - sprintf(name,"h_gLLPpt_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLPpt_Bx0_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_Bx0_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLPpt_Bx1_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLPpt_Bx1_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_gLLP_travel_time_fullVeto_%s_%s",mX[itr_mX],ctau); - h_gLLP_travel_time_fullVeto[itr_file] = new TH1D(name,"",100,0,10000); - - sprintf(name,"h_npv_nDtRechitClusters_fullVeto_%s_%s",mX[itr_mX],ctau); - h_npv_nDtRechitClusters_fullVeto[itr_file] = new TH2D(name,"",10,0,10,5,0,5); - - sprintf(name,"h_RPCMatchedBx_invertedJetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuonVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedMuonVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_RPCMatchedBx_invertedMuJetVeto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBx_invertedMuJetVeto[itr_file] = new TH1D(name,"",13,-6.5,6.5); - - sprintf(name,"h_dtRechitClusterSize_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterSizeBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterNStation_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_noMB1Veto[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",50,0,500); - - sprintf(name,"h_dtRechitClusterPercentRechitsMB1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_nRPCMatched_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatched_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer1_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer1_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer2_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer2_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_nRPCMatchedLayer12_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nRPCMatchedLayer12_noMB1Veto[itr_file] = new TH1D(name,"",20,0,20); - - sprintf(name,"h_RPCMatchedBxSpread_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_RPCMatchedBxSpread_noMB1Veto[itr_file] = new TH1D(name,"",10,0,10); - - sprintf(name,"h_dtRechitClusterSizeBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_HOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSizeAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_noVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_noVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_jetVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_jetVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_MB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_MB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_noMB1Veto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_HOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_HOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_fullVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_fullVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsAll_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsAll_fullHOVeto[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_RPCMatch[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterSize_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSize_RPCSpread0[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsBarrel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_nTotalClusteredRechitsMagnet_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file] = new TH1D(name,"",100,0,1000); - - sprintf(name,"h_dtRechitClusterXSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterXSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterYSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,400); - - sprintf(name,"h_dtRechitClusterZSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file] = new TH1D(name,"",30,0,150); - - sprintf(name,"h_dtRechitClusterEtaSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterPhiSpread_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file] = new TH1D(name,"",40,0,0.4); - - sprintf(name,"h_dtRechitClusterEta_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEta_fullVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_dtRechitClusterPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterPhi_fullVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_dtRechitClusterEtaPhi_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file] = new TH2D(name,"",70,-3.5,3.5,60,-3,3); - - sprintf(name,"h_dtRechitClusterNStation_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterNWheel_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterNStation_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file] = new TH1D(name,"",4,0,4); - - sprintf(name,"h_dtRechitClusterNWheel_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file] = new TH1D(name,"",5,0,5); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoPlus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_dtRechitClusterSizeRatio_fullVetoMinus_%s_%s",mX[itr_mX],ctau); - h_dtRechitClusterSizeRatio_fullVetoMinus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_HOMatchedEnergyCluster280Magnet_noMB1Veto_%s_%s",mX[itr_mX],ctau); - h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOTime_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_HOTime_fullHOVeto[itr_file] = new TH1D(name,"",60,-60,60); - - sprintf(name,"h_muonPt_jetMB1Veto_%s_%s",mX[itr_mX],ctau); - h_muonPt_jetMB1Veto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonMB1Veto_%s_%s",mX[itr_mX],ctau); - h_jetPt_muonMB1Veto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_MB1Rechits_jetMuonVeto_%s_%s",mX[itr_mX],ctau); - h_MB1Rechits_jetMuonVeto[itr_file] = new TH1D(name,"",200,0,200); - - sprintf(name,"h_muonPt_jetHOVeto_%s_%s",mX[itr_mX],ctau); - h_muonPt_jetHOVeto[itr_file] = new TH1D(name,"",50,0,100); - - sprintf(name,"h_jetPt_muonHOVeto_%s_%s",mX[itr_mX],ctau); - h_jetPt_muonHOVeto[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_HOEnergy_jetMuonVeto_%s_%s",mX[itr_mX],ctau); - h_HOEnergy_jetMuonVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_muonDR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_muonDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_muonDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_muonDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullVeto_%s_%s",mX[itr_mX],ctau); - h_jetDR_fullVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCMatch_%s_%s",mX[itr_mX],ctau); - h_jetDR_RPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_RPCSpread0_%s_%s",mX[itr_mX],ctau); - h_jetDR_RPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_muonDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); - h_muonDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_muonDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); - h_muonDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_fullHOVeto_%s_%s",mX[itr_mX],ctau); - h_jetDR_fullHOVeto[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCMatch_%s_%s",mX[itr_mX],ctau); - h_jetDR_HORPCMatch[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetDR_HORPCSpread0_%s_%s",mX[itr_mX],ctau); - h_jetDR_HORPCSpread0[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_decayVertexRadius_noVeto_%s_%s",mX[itr_mX],ctau); - h_decayVertexRadius_noVeto[itr_file] = new TH1D(name,"",80,0,800); - - sprintf(name,"h_HOEnergy_jetVeto_%s_%s",mX[itr_mX],ctau); - h_HOEnergy_jetVeto[itr_file] = new TH1D(name,"",40,0,200); - - sprintf(name,"h_dRClusterRPC_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dRClusterRPC_jetVeto[itr_file] = new TH1D(name,"",30,0,3); - - sprintf(name,"h_dRClusterHO_jetVeto_%s_%s",mX[itr_mX],ctau); - h_dRClusterHO_jetVeto[itr_file] = new TH1D(name,"",30,0,3); - - sprintf(name,"h_jetDR_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetDR_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetPt_minDR_vetoJet[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetEta_minDR_vetoJet[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetPhi_minDR_vetoJet[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_vetoJet_%s_%s",mX[itr_mX],ctau); - h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetDR_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetDR_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,2); - - sprintf(name,"h_jetPt_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPt_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",20,0,200); - - sprintf(name,"h_jetEta_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetEta_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",60,-3,3); - - sprintf(name,"h_jetPhi_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetPhi_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",70,-3.5,3.5); - - sprintf(name,"h_jetChargedEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralEMEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetChargedHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - sprintf(name,"h_jetNeutralHadronEnergyFracion_minDR_fullHOVetoPlus_%s_%s",mX[itr_mX],ctau); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file] = new TH1D(name,"",25,0,1); - - evtNum = 0; - totalNum = 0; - //weight = lumi*xSec*1000/treeReader.GetEntries(1); - totalEvents=0; - totalMagnetEvents=0; - totalBarrelEvents=0; - noEff=0.0; - muonEff=0.0; - jetEff=0.0; - MB1Eff=0.0; - HOEff=0.0; - fullEff=0.0; - fullHOEff=0.0; - - nPassMET=0; - nPassDTDecay=0; - nPassJetMET=0; - nPassNoVeto=0; - nPassFullVeto=0; - - nPassMaxStation=0; - nPassDeltaPhi=0; - nPassRPCMatch=0; - nPassRPCSpread=0; - - nPassHODecay=0; - nPassNoVeto_ho=0; - nPassFullVeto_ho=0; - nPassDeltaPhi_ho=0; - nPassRPCMatch_ho=0; - nPassRPCSpread_ho=0; - - cout << mX[itr_mX] << "_" << ctau << endl; - for(Int_t itr_year = 0; itr_year<3; itr_year++) { - cout << " " << years[itr_year] << endl; - - TFile *_file; - if(strcmp(years[itr_year],"MC_Summer16")==0){ - cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root" << endl; - //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - } - else{ - cout << "Attempt to open " << dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" << endl; - //_file = TFile::Open(dir+years[itr_year]+"/v1/v2/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - _file = TFile::Open(dir+years[itr_year]+"/v3/v5/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - } - cout << "Opened ntuple files" << endl; - - /*if(strcmp(mX[itr_mX],"450")==0){ - _file = TFile::Open(dir+"/signal_1000_"+mX[itr_mX]+"_"+ctau+".root"); - } - else{ - _file = TFile::Open(dir+"/signal_125_"+mX[itr_mX]+"_"+ctau+".root"); - } - - TTreeReader treeReader("ntuples/llp",_file); - */ - TTreeReader treeReader("MuonSystem",_file); - - TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); - //TTreeReaderArray gLLP_dt(treeReader,"gLLP_dt"); - //TTreeReaderArray gLLP_pt(treeReader,"gLLP_pt"); - TTreeReaderArray gLLP_decay_vertex_x(treeReader,"gLLP_decay_vertex_x"); - TTreeReaderArray gLLP_decay_vertex_y(treeReader,"gLLP_decay_vertex_y"); - TTreeReaderArray gLLP_decay_vertex_z(treeReader,"gLLP_decay_vertex_z"); - //TTreeReaderArray gLLP_travel_time(treeReader,"gLLP_travel_time"); - - //TTreeReaderValue weight(treeReader,"weight"); - //TTreeReaderValue npv(treeReader,"npv"); - TTreeReaderValue MET(treeReader,"met"); - TTreeReaderValue METphi(treeReader,"metPhi"); - //TTreeReaderValue MET(treeReader,"metType1Pt"); - //TTreeReaderValue METphi(treeReader,"metType1Phi"); - //TTreeReaderValue jetMet_dPhiMin4(treeReader,"jetMet_dPhiMin4"); - - TTreeReaderValue nDtRechitClusters(treeReader,"nDtRechitClusters"); - TTreeReaderArray dtRechitClusterX(treeReader,"dtRechitClusterX"); - TTreeReaderArray dtRechitClusterY(treeReader,"dtRechitClusterY"); - TTreeReaderArray dtRechitClusterZ(treeReader,"dtRechitClusterZ"); - TTreeReaderArray dtRechitClusterPhi(treeReader,"dtRechitClusterPhi"); - TTreeReaderArray dtRechitClusterEta(treeReader,"dtRechitClusterEta"); - TTreeReaderArray dtRechitClusterXSpread(treeReader,"dtRechitClusterXSpread"); - TTreeReaderArray dtRechitClusterYSpread(treeReader,"dtRechitClusterYSpread"); - TTreeReaderArray dtRechitClusterZSpread(treeReader,"dtRechitClusterZSpread"); - TTreeReaderArray dtRechitClusterPhiSpread(treeReader,"dtRechitClusterPhiSpread"); - TTreeReaderArray dtRechitClusterEtaSpread(treeReader,"dtRechitClusterEtaSpread"); - TTreeReaderArray dtRechitClusterJetVetoPt(treeReader,"dtRechitClusterJetVetoPt"); - TTreeReaderArray dtRechitClusterMuonVetoPt(treeReader,"dtRechitClusterMuonVetoPt"); - TTreeReaderArray dtRechitClusterSize(treeReader,"dtRechitClusterSize"); - TTreeReaderArray dtRechitClusterNSegmentStation1(treeReader,"dtRechitClusterNSegmentStation1"); - TTreeReaderArray dtRechitClusterMaxStation(treeReader,"dtRechitClusterMaxStation"); - TTreeReaderArray dtRechitClusterNStation(treeReader,"dtRechitClusterNStation"); - TTreeReaderArray dtRechitClusterMaxChamber(treeReader,"dtRechitClusterMaxChamber"); - TTreeReaderArray dtRechitClusterNChamber(treeReader,"dtRechitClusterNChamber"); - - /*TTreeReaderValue nDtRechits(treeReader,"nDtRechits"); - TTreeReaderArray dtRechitX(treeReader,"dtRechitX"); - TTreeReaderArray dtRechitY(treeReader,"dtRechitY"); - TTreeReaderArray dtRechitZ(treeReader,"dtRechitZ"); - TTreeReaderArray dtRechitEta(treeReader,"dtRechitEta"); - TTreeReaderArray dtRechitPhi(treeReader,"dtRechitPhi"); - TTreeReaderArray dtRechitStation(treeReader,"dtRechitStation"); - TTreeReaderArray dtRechitWheel(treeReader,"dtRechitWheel"); - */ - TTreeReaderValue nJets(treeReader,"nJets"); - TTreeReaderArray jetPt(treeReader,"jetPt"); - TTreeReaderArray jetEta(treeReader,"jetEta"); - TTreeReaderArray jetPhi(treeReader,"jetPhi"); - TTreeReaderArray jetChargedEMEnergyFraction(treeReader,"jetChargedEMEnergyFraction"); - TTreeReaderArray jetNeutralEMEnergyFraction(treeReader,"jetNeutralEMEnergyFraction"); - TTreeReaderArray jetNeutralHadronEnergyFraction(treeReader,"jetNeutralHadronEnergyFraction"); - TTreeReaderArray jetChargedHadronEnergyFraction(treeReader,"jetChargedHadronEnergyFraction"); - - TTreeReaderValue nMuons(treeReader,"nMuons"); - TTreeReaderArray muonEta(treeReader,"muonEta"); - TTreeReaderArray muonPhi(treeReader,"muonPhi"); - TTreeReaderArray muonPt(treeReader,"muonPt"); - - TTreeReaderValue nRPCRechits(treeReader,"nRpc"); - TTreeReaderArray RPCRechitX(treeReader,"rpcX"); - TTreeReaderArray RPCRechitY(treeReader,"rpcY"); - TTreeReaderArray RPCRechitZ(treeReader,"rpcZ"); - TTreeReaderArray RPCRechitPhi(treeReader,"rpcPhi"); - TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); - - TTreeReaderValue nHORechits(treeReader,"nHORechits"); - TTreeReaderArray HORechitE(treeReader,"hoRechit_E"); - TTreeReaderArray HORechitT(treeReader,"hoRechit_T"); - TTreeReaderArray HORechitEta(treeReader,"hoRechit_Eta"); - TTreeReaderArray HORechitPhi(treeReader,"hoRechit_Phi"); - - totalNum += treeReader.GetEntries(1); - cout << "Loop on " << totalNum << " entries." << endl; - _ofile->cd(); - while(treeReader.Next()){ - goodEvt = false; - goodDecay = false; - magnetDecay = false; - clustSizeMax = 0.; - dPhi_min = 999.; - jetPt_tmp = 0.0; - if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } - - for(Int_t itr_llp=0; itr_llp<2; itr_llp++){ - if(gLLP_decay_vertex_z[itr_llp] < 650.){ - h_decayVertexRadius_noVeto[itr_file]->Fill(sqrt(pow(gLLP_decay_vertex_x[itr_llp],2)+pow(gLLP_decay_vertex_y[itr_llp],2))); - } - } - if(gLLP_dt[0] || gLLP_dt[1]){ goodDecay = true; } - else if(sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[0],2)+pow(gLLP_decay_vertex_y[0],2)) > 300. && abs(gLLP_decay_vertex_z[0]) < 650.){ magnetDecay = true; } - else if(sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[0],2)) < 400. && sqrt(pow(gLLP_decay_vertex_x[1],2)+pow(gLLP_decay_vertex_y[1],2)) > 300. && abs(gLLP_decay_vertex_z[1]) < 650.){ magnetDecay = true; } - if(*MET > 200){ - //nPassMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - nPassMET += 1; - } - if(*MET > 200){ - //nPassDTDecay += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - nPassDTDecay += 1; - passNoVeto = false; - passFullVeto = false; - passRPCMatch = false; - passRPCSpread = false; - passMaxStation = false; - passDeltaPhi = false; - passFullVeto_ho = false; - passRPCMatch_ho = false; - passRPCSpread_ho = false; - passDeltaPhi_ho = false; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - totalSumE=0.0; - totalBarrelEvents+=1; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - totalClusteredFullPlus = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - //h_jetMet_dPhiMin4[itr_file]->Fill(*jetMet_dPhiMin4); - if(*nJets>0){ - goodJets=0; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - } - goodJets+=1; - if(goodJets==4){ break; } - } - } - } - if(dPhi_min!=999.){ h_dPhiJetMET[itr_file]->Fill(fabs(dPhi_min)); } - if(fabs(dPhi_min)>0.6){ - //if(fabs(dPhiClusterMET_max)<1.0){ - //nPassJetMET += lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); - nPassJetMET += 1; - h_MET[itr_file]->Fill(*MET); - h_jetPt[itr_file]->Fill(jetPt_tmp); - - if(*nDtRechitClusters > 0){ passNoVeto = true; } - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - passJet = true; - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(jetPt[itr_jet]>20.){ - dPhi_tmp = RPCRechitPhi[itr_jet] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr_jet]-dtRechitClusterEta[itr_clust],2))<0.5){ - passJet = false; - break; - } - } - } - if(!passJet){ passInvertedJet = true; } - //if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - //else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - if(dtRechitClusterSize[itr_clust]>50){ - - nPassNone+=1; - noEff+=1.0; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(sumE>40.){ passHO = true; } - - muonPt_max = 0.0; - muonDR_min = 999.0; - for(Int_t itr=0; itr<*nMuons; itr++){ - dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(muonPt[itr]>muonPt_max){ - muonPt_max=muonPt[itr]; - } - } - if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(jetPt[itr]>jetPt_max){ - jetPt_max=jetPt[itr]; - } - } - if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))Fill(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))); - h_jetPt_minDR_vetoJet[itr_file]->Fill(jetPt[itr]); - h_jetEta_minDR_vetoJet[itr_file]->Fill(jetEta[itr]); - h_jetPhi_minDR_vetoJet[itr_file]->Fill(jetPhi[itr]); - h_jetChargedEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedEMEnergyFraction[itr]); - h_jetNeutralEMEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralEMEnergyFraction[itr]); - h_jetChargedHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetChargedHadronEnergyFraction[itr]); - h_jetNeutralHadronEnergyFraction_minDR_vetoJet[itr_file]->Fill(jetNeutralHadronEnergyFraction[itr]); - } - } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - - h_dtRechitClusterSize_noVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_noVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_noVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_noVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_noVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_noVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_noVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_noVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_noVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_noVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_noVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_noVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_noVeto[itr_file]->Fill(match); } - } - - if(passMuon){ - nPassMuon+=1; - muonEff+=1.0; - h_dtRechitClusterSize_muonVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_muonVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_muonVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_muonVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_muonVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_muonVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_muonVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_muonVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_muonVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_muonVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_muonVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_muonVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_muonVeto[itr_file]->Fill(match); } - } - } - - if(passJet){ - nPassJet+=1; - jetEff+=1.0; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_jetVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_jetVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_jetVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_jetVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_jetVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_jetVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_jetVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_jetVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_jetVeto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_jetVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_jetVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_jetVeto[itr_file]->Fill(match); } - } - } - - if(passMB1){ - nPassMB1+=1; - MB1Eff+=1.0; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_MB1Veto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_MB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_MB1Veto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_MB1Veto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_MB1Veto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_MB1Veto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_MB1Veto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_MB1Veto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_MB1Veto[itr_file]->Fill(match); - if(!rpcBx.empty()){ - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_MB1Veto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_MB1Veto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_MB1Veto[itr_file]->Fill(match); } - } - } - - if(passInvertedJet && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passInvertedMuon && passMB1){ - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - - if(passInvertedJet && passInvertedMuon && passMB1){ - //cout << "inverted mu jet" << endl; - if(!rpcBx.empty()){ - for(Int_t itr = 0; itrFill(rpcBx[itr]); - } - } - } - //cout << "done inverted" << endl; - - if(passMuon && passJet){ - //cout << "no MB1" << endl; - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNRechitsMB1_noMB1Veto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - h_dtRechitClusterPercentRechitsMB1_noMB1Veto[itr_file]->Fill(float(dtRechitClusterNSegmentStation1[itr_clust]) / dtRechitClusterSize[itr_clust]); - h_dtRechitClusterNStation_noMB1Veto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_nRPCMatched_noMB1Veto[itr_file]->Fill(match); - h_MB1Rechits_jetMuonVeto[itr_file]->Fill(dtRechitClusterNSegmentStation1[itr_clust]); - if(!rpcLayer.empty()){ - h_RPCMatchedBxSpread_noMB1Veto[itr_file]->Fill(max_element(rpcBx.begin(),rpcBx.end()) - min_element(rpcBx.begin(),rpcBx.end())); - for(Int_t itr = 0; itrFill(matchLayer1); - h_nRPCMatchedLayer2_noMB1Veto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedLayer12_noMB1Veto[itr_file]->Fill(matchLayer1+matchLayer2); - } - //cout << "done no MB1" << endl; - - if(passMuon && passJet && passMB1){ - passFullVeto = true; - nPassFull+=1; - fullEff+=1.0; - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSize_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSizeBarrel_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_dtRechitClusterNStation_fullVeto[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dPhiClusterMET_fullVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_dtRechitClusterXSpread_fullVeto[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVeto[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVeto[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVeto[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVeto[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_nRPCMatched_fullVeto[itr_file]->Fill(match); - - h_dtRechitClusterEta_fullVeto[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterPhi_fullVeto[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterR_fullVeto[itr_file]->Fill(sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust]); - h_dtRechitClusterRZ_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - h_dtRechitClusterRZFine_fullVeto[itr_file]->Fill(dtRechitClusterZ[itr_clust],sqrt(pow(dtRechitClusterX[itr_clust],2)+pow(dtRechitClusterY[itr_clust],2))); - - h_dtRechitClusterNWheels1_fullVeto[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_dtRechitClusterMaxWheel_fullVeto[itr_file]->Fill(dtRechitClusterMaxChamber[itr_clust]); - - //h_gLLP_travel_time_fullVeto[itr_file]->Fill(gLLP_travel_time[llp_itr]); - //h_gLLPpt_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); - if(!rpcBx.empty()){ - rpcMean = accumulate(rpcBx.begin(), rpcBx.end(), 0.0) / rpcBx.size(); - //if(abs(rpcMean)<0.5){ h_gLLPpt_Bx0_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } - //else if(rpcMean < 1.5){ h_gLLPpt_Bx1_fullVeto[itr_file]->Fill(gLLP_pt[llp_itr]); } - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - for(Int_t itr = 0; itrFill(rpcBx[itr]); - if(rpcSpread==0){ h_RPCMatchedBx_Spread0_fullVeto[itr_file]->Fill(rpcBx[itr]); } - } - h_RPCMatchedBxSpread_fullVeto[itr_file]->Fill(rpcSpread); - if(rpcSpread==0){ h_nRPCMatched_Spread0_fullVeto[itr_file]->Fill(match); } - } - - h_muonDR_fullVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullVeto[itr_file]->Fill(jetDR_min); - - if(!rpcBx.empty()){ - passRPCMatch = true; - h_dtRechitClusterSize_RPCMatch[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_RPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread = true; - h_dtRechitClusterSize_RPCSpread0[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_muonDR_RPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_RPCSpread0[itr_file]->Fill(jetDR_min); - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation = true; - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi = true; - totalClusteredFullPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterXSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterXSpread[itr_clust]); - h_dtRechitClusterYSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterYSpread[itr_clust]); - h_dtRechitClusterZSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterZSpread[itr_clust]); - h_dtRechitClusterEtaSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterEtaSpread[itr_clust]); - h_dtRechitClusterPhiSpread_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhiSpread[itr_clust]); - h_dtRechitClusterPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust]); - h_dtRechitClusterEta_fullVetoPlus[itr_file]->Fill(dtRechitClusterEta[itr_clust]); - h_dtRechitClusterEtaPhi_fullVetoPlus[itr_file]->Fill(dtRechitClusterPhi[itr_clust],dtRechitClusterEta[itr_clust]); - h_dtRechitClusterNStation_fullVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNWheel_fullVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - //h_dtRechitClusterSizeRatio_fullVetoPlus[itr_file]->Fill(dtRechitClusterSize[itr_clust] / float(*nDtRechits)); - } - } - } - } - - } - - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeBarrel_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - /*if(passMuon && passJet && passHO){ - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeBarrel_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - }*/ - - if(passMuon && passMB1){ - h_jetPt_muonMB1Veto[itr_file]->Fill(jetPt_max); - } - - if(passJet && passMB1){ - h_muonPt_jetMB1Veto[itr_file]->Fill(muonPt_max); - } - if(passJet && passMuon && passHO){ - passFullVeto_ho = true; - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); - h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); - h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - - h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); - - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - passRPCMatch_ho = true; - h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread_ho = true; - h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi_ho = true; - totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterNStation_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNStation[itr_clust]); - h_dtRechitClusterNWheel_fullHOVetoPlus[itr_file]->Fill(dtRechitClusterNChamber[itr_clust]); - h_jetDR_minDR_fullHOVetoPlus[itr_file]->Fill(jetDR_min); - h_jetPt_minDR_fullHOVetoPlus[itr_file]->Fill(jetPt[jetDR_index]); - h_jetEta_minDR_fullHOVetoPlus[itr_file]->Fill(jetEta[jetDR_index]); - h_jetPhi_minDR_fullHOVetoPlus[itr_file]->Fill(jetPhi[jetDR_index]); - h_jetChargedEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedEMEnergyFraction[jetDR_index]); - h_jetNeutralEMEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralEMEnergyFraction[jetDR_index]); - h_jetChargedHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetChargedHadronEnergyFraction[jetDR_index]); - h_jetNeutralHadronEnergyFraction_minDR_fullHOVetoPlus[itr_file]->Fill(jetNeutralHadronEnergyFraction[jetDR_index]); - } - } - } - } - } - } - if(passFullVeto_ho){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch_ho){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread_ho){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi_ho){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - if(passNoVeto){ nPassNoVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passFullVeto){ nPassFullVeto += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch){ nPassRPCMatch += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread){ nPassRPCSpread += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passMaxStation){ nPassMaxStation += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi){ nPassDeltaPhi += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - h_nDtRechitClusters_noVeto[itr_file]->Fill(nPassNone); - h_nDtRechitClusters_muonVeto[itr_file]->Fill(nPassMuon); - h_nDtRechitClusters_jetVeto[itr_file]->Fill(nPassJet); - h_nDtRechitClusters_MB1Veto[itr_file]->Fill(nPassMB1); - h_nDtRechitClusters_fullVeto[itr_file]->Fill(nPassFull); - - if(nPassNone>0){ h_dPhiJetMETBarrel_noVeto[itr_file]->Fill(dPhi_min); } - if(nPassMuon>0){ h_dPhiJetMETBarrel_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETBarrel_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETBarrel_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETBarrel_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ h_dPhiJetMETBarrel_fullVeto[itr_file]->Fill(dPhi_min); } - //h_npv_nDtRechitClusters_noVeto[itr_file]->Fill(*npv,nPassNone); - //h_npv_nDtRechitClusters_fullVeto[itr_file]->Fill(*npv,nPassFull); - h_nTotalClusteredRechitsBarrel_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsBarrel_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsBarrel_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsBarrel_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsBarrel_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsBarrel_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsBarrel_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - - h_dPhiClusterMETMax[itr_file]->Fill(dPhiClusterMET_max); - - h_nTotalClusteredRechitsBarrel_fullVetoPlus[itr_file]->Fill(totalClusteredFullPlus); - } - } - - /*if(*MET>200 && magnetDecay){ - nPassHODecay+=1; - totalMagnetEvents+=1; - passNoVeto = false; - passFullVeto = false; - passRPCMatch = false; - passRPCSpread = false; - passMaxStation = false; - passDeltaPhi = false; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - goodJets=0; - totalSumE=0.0; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - totalClusteredFullHOPlus = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - } - goodJets+=1; - if(goodJets==4){ break; } - } - } - h_dPhiJetMETMagnet[itr_file]->Fill(fabs(dPhi_min)); - if(fabs(dPhi_min)>0.6){ - //if(fabs(dPhiClusterMET_max)<1.0){ - nPassJetMET+=1; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - passNoVeto = true; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(RPCRechitZ[itr_rpc] - dtRechitClusterZ[itr_clust])<5. && fabs(dPhi_tmp)<0.4){ - match+=1; - rpcBx.push_back(RPCRechitBx[itr_rpc]); - rpcLayer.push_back(getRPCLayer(RPCRechitX[itr_rpc],RPCRechitY[itr_rpc])); - } - } - rpcSpread = max_element(rpcBx.begin(), rpcBx.end()) - min_element(rpcBx.begin(), rpcBx.end()); - if(!rpcLayer.empty()){ - for(Int_t itr = 0; itr TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(passJet){ - h_dRClusterHO_jetVeto[itr_file]->Fill(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))); - } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(passJet){ - h_HOEnergy_jetVeto[itr_file]->Fill(sumE); - } - if(sumE>40.){ passHO = true; } - - muonPt_max = 0.0; - muonDR_min = 999.0; - for(Int_t itr=0; itr<*nMuons; itr++){ - dPhi_tmp = muonPhi[itr] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(muonPt[itr]>muonPt_max){ - muonPt_max=muonPt[itr]; - } - } - if(muonPt[itr]>10.&&sqrt(pow(dPhi_tmp,2)+pow(muonEta[itr]-dtRechitClusterEta[itr_clust],2)) TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))<0.4){ - if(jetPt[itr]>jetPt_max){ - jetPt_max=jetPt[itr]; - } - } - if(jetPt[itr]>20.&&sqrt(pow(dPhi_tmp,2)+pow(jetEta[itr]-dtRechitClusterEta[itr_clust],2))50){ - - nPassNone+=1; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - if(passMuon){ - nPassMuon+=1; - } - if(passJet){ - nPassJet+=1; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_nRPCMatchedMagnet_jetVeto[itr_file]->Fill(match); - - h_nRPCMatchedMagnetLayer1_jetVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_jetVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_jetVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_jetVeto[itr_file]->Fill(matchLayer4); - } - if(passMB1){ - nPassMB1+=1; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon){ - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_HOEnergy_jetMuonVeto[itr_file]->Fill(sumE); - if(dtRechitClusterSize[itr_clust]>=280){ - totalSumE+=sumE; - } - } - if(passJet && passHO){ - h_muonPt_jetHOVeto[itr_file]->Fill(muonPt_max); - } - if(passMuon && passHO){ - h_jetPt_muonHOVeto[itr_file]->Fill(jetPt_max); - } - if(passJet && passMuon && passMB1){ - nPassFull+=1; - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passHO){ - passFullVeto = true; - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeMagnet_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterMaxStation_fullHOVeto[itr_file]->Fill(dtRechitClusterMaxStation[itr_clust]); - h_nRPCMatched_fullHOVeto[itr_file]->Fill(match); - h_RPCMatchedBxSpread_fullHOVeto[itr_file]->Fill(rpcSpread); - h_dPhiClusterMET_fullHOVeto[itr_file]->Fill(fabs(dPhiClusterMET)); - h_HOTime_fullHOVeto[itr_file]->Fill(weightT/sumE); - - h_muonDR_fullHOVeto[itr_file]->Fill(muonDR_min); - h_jetDR_fullHOVeto[itr_file]->Fill(jetDR_min); - - h_nRPCMatchedMagnetLayer1_fullHOVeto[itr_file]->Fill(matchLayer1); - h_nRPCMatchedMagnetLayer2_fullHOVeto[itr_file]->Fill(matchLayer2); - h_nRPCMatchedMagnetLayer3_fullHOVeto[itr_file]->Fill(matchLayer3); - h_nRPCMatchedMagnetLayer4_fullHOVeto[itr_file]->Fill(matchLayer4); - - if(!rpcBx.empty()){ - passRPCMatch = true; - h_muonDR_HORPCMatch[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCMatch[itr_file]->Fill(jetDR_min); - if(rpcSpread==0){ - passRPCSpread = true; - h_muonDR_HORPCSpread0[itr_file]->Fill(muonDR_min); - h_jetDR_HORPCSpread0[itr_file]->Fill(jetDR_min); - if(fabs(dPhiClusterMET)<1){ - passDeltaPhi = true; - totalClusteredFullHOPlus+=dtRechitClusterSize[itr_clust]; - } - } - } - } - } - } - h_HOMatchedEnergyCluster280Magnet_noMB1Veto[itr_file]->Fill(totalSumE); - - if(passNoVeto){ nPassNoVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passFullVeto){ nPassFullVeto_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCMatch){ nPassRPCMatch_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passRPCSpread){ nPassRPCSpread_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - if(passDeltaPhi){ nPassDeltaPhi_ho += 1; }//lumi[itr_year] * 1000. * 48.58 * 0.01 / treeReader.GetEntries(1); } - - if(nPassNone>0){ h_dPhiJetMETMagnet_noVeto[itr_file]->Fill(dPhi_min); } - if(nPassMuon>0){ h_dPhiJetMETMagnet_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETMagnet_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETMagnet_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETMagnet_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ h_dPhiJetMETMagnet_fullVeto[itr_file]->Fill(dPhi_min); } - if(nPassFullHO>0){ h_dPhiJetMETMagnet_fullHOVeto[itr_file]->Fill(dPhi_min); } - - h_nTotalClusteredRechitsMagnet_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsMagnet_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsMagnet_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsMagnet_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsMagnet_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsMagnet_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsMagnet_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - h_nTotalClusteredRechitsMagnet_fullHOVetoPlus[itr_file]->Fill(totalClusteredFullHOPlus); - } - }*/ - /*if(*MET>200){ - totalEvents+=1; - nPassMuon = 0; - nPassJet = 0; - nPassJetMuon = 0; - nPassMB1 = 0; - nPassHO = 0; - nPassFull = 0; - nPassFullHO = 0; - nPassNone = 0; - goodJets=0; - totalSumE=0.0; - totalClusteredNone = 0; - totalClusteredNoMB1 = 0; - totalClusteredJet = 0; - totalClusteredMB1 = 0; - totalClusteredHO = 0; - totalClusteredFull = 0; - totalClusteredFullHO = 0; - dPhiClusterMET_max = -1.; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>20.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - jetPt_tmp = jetPt[itr_jet]; - } - goodJets+=1; - if(goodJets==4){ break; } - } - } - if(fabs(dPhi_min)>0.6){ - //if(fabs(dPhiClusterMET_max)<1.0){ - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - match = 0; - matchLayer1 = 0; - matchLayer2 = 0; - matchLayer3 = 0; - matchLayer4 = 0; - matchHO = 0; - sumE = 0; - weightT = 0; - rpcBx.clear(); - rpcLayer.clear(); - zWheel.clear(); - matchJet = false; - matchMuon = false; - goodEvt = true; - passMuon = false; - passJet = false; - passMB1 = false; - passHO = false; - passInvertedJet = false; - passInvertedMuon = false; - passInvertedMuJet = false; - llp_itr = -1; - - if(sqrt(pow(gLLP_decay_vertex_x[0]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[0]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[0]-dtRechitClusterZ[itr_clust],2)) < sqrt(pow(gLLP_decay_vertex_x[1]-dtRechitClusterX[itr_clust],2)+pow(gLLP_decay_vertex_y[1]-dtRechitClusterY[itr_clust],2)+pow(gLLP_decay_vertex_z[1]-dtRechitClusterZ[itr_clust],2))){ llp_itr = 0; } - else{ llp_itr = 1; } - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - else{ passInvertedJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - else{ passInvertedMuon = true; } - if(dtRechitClusterNSegmentStation1[itr_clust]==0){ passMB1 = true; } - - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = HORechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(HORechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - matchHO+=1; - sumE += HORechitE[itr_ho]; - weightT += HORechitT[itr_ho]*HORechitE[itr_ho]; - } - } - if(sumE>40.){ passHO = true; } - - if(dtRechitClusterSize[itr_clust]>50){ - - nPassNone+=1; - totalClusteredNone+=dtRechitClusterSize[itr_clust]; - - if(passMuon){ - nPassMuon+=1; - } - if(passJet){ - nPassJet+=1; - totalClusteredJet+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_jetVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passMB1){ - nPassMB1+=1; - totalClusteredMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_MB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon){ - nPassJetMuon+=1; - totalClusteredNoMB1+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_noMB1Veto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passMB1){ - nPassFull+=1; - totalClusteredFull+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_fullVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passHO){ - nPassHO+=1; - totalClusteredHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_HOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - if(passJet && passMuon && passHO){ - nPassFullHO+=1; - totalClusteredFullHO+=dtRechitClusterSize[itr_clust]; - h_dtRechitClusterSizeAll_fullHOVeto[itr_file]->Fill(dtRechitClusterSize[itr_clust]); - } - } - } - if(nPassNone>0){ h_dPhiJetMETAll_noVeto[itr_file]->Fill(dPhi_min); } - if(nPassMuon>0){ h_dPhiJetMETAll_muonVeto[itr_file]->Fill(dPhi_min); } - if(nPassJet>0){ h_dPhiJetMETAll_jetVeto[itr_file]->Fill(dPhi_min); } - if(nPassMB1>0){ h_dPhiJetMETAll_MB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassJetMuon>0){ h_dPhiJetMETAll_noMB1Veto[itr_file]->Fill(dPhi_min); } - if(nPassFull>0){ h_dPhiJetMETAll_fullVeto[itr_file]->Fill(dPhi_min); } - - h_nTotalClusteredRechitsAll_noVeto[itr_file]->Fill(totalClusteredNone); - h_nTotalClusteredRechitsAll_jetVeto[itr_file]->Fill(totalClusteredJet); - h_nTotalClusteredRechitsAll_MB1Veto[itr_file]->Fill(totalClusteredMB1); - h_nTotalClusteredRechitsAll_noMB1Veto[itr_file]->Fill(totalClusteredNoMB1); - h_nTotalClusteredRechitsAll_HOVeto[itr_file]->Fill(totalClusteredHO); - h_nTotalClusteredRechitsAll_fullVeto[itr_file]->Fill(totalClusteredFull); - h_nTotalClusteredRechitsAll_fullHOVeto[itr_file]->Fill(totalClusteredFullHO); - } - }*/ - evtNum+=1; - } - - } - //cout << "Total events = " << totalEvents << endl; - //cout << "Total magnet events = " << totalMagnetEvents << endl; - //cout << "Total barrel events = " << totalBarrelEvents << endl; - - cout << "MET > 200: " << nPassMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - //cout << "DT Decay: " << nPassDTDecay * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "No Veto: " << nPassNoVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full Veto: " << nPassFullVeto * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Max Station > 2: " << nPassMaxStation * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - //cout << "HO Decay: " << nPassHODecay * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(jet,MET) > 0.6: " << nPassJetMET * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "No Veto: " << nPassNoVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "Full Veto: " << nPassFullVeto_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "nRPC Matched > 0: " << nPassRPCMatch_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "RPC Spread = 0: " << nPassRPCSpread_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << "dPhi(Cluster,MET) < 1: " << nPassDeltaPhi_ho * 137.0 * 1000. * 48.58 * 0.01 << endl; - cout << " " << endl; - - itr_file+=1; - } - - _ofile->Write(); - _ofile->Close(); - -} From d38016a52c493f8e7bed530437c9f8ca7e6379c0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 16:18:18 -0500 Subject: [PATCH 10/15] update instructions --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bceec55..0ac2698 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,12 @@ git clone git@github.com:dildick/dt_analysis_code.git Running the signal analysis -root -l -q -b analyzeSignal.C++ \ No newline at end of file +
+root -l -q -b analyzeSignal_ABCD.C++
+
+ +Running the data analysis + +
+root -l -q -b analyzeData_ABCD.C++
+
From 96a0aa6441826c95008ba11440622fed5721e815 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 17:24:10 -0500 Subject: [PATCH 11/15] skim --- .gitignore | 4 + analyzeSignal_ABCD.C | 1044 +++++++++++++++++++++--------------------- signalfiles.h | 28 ++ skim.C | 25 + 4 files changed, 580 insertions(+), 521 deletions(-) create mode 100644 signalfiles.h create mode 100644 skim.C diff --git a/.gitignore b/.gitignore index 259148f..4bed096 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ *.exe *.out *.app + +*.pcm + +*.C~ \ No newline at end of file diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 2937c25..1c1d045 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -1,6 +1,7 @@ R__LOAD_LIBRARY(libTreePlayer) #include "helpers.h" +#include "signalfiles.h" #include #include #include @@ -408,7 +409,8 @@ void analyzeSignal_ABCD(){ _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); } else{ - _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + // _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); + _file = TFile::Open(TString(skimsignalfiles[itr_year])); } TTreeReader treeReader("MuonSystem",_file); @@ -471,13 +473,13 @@ void analyzeSignal_ABCD(){ TTreeReaderArray RPCRechitBx(treeReader,"rpcBx"); /*TTreeReaderValue nHORechits(treeReader,"nHORechits"); - TTreeReaderArray hoRechitX(treeReader,"hoRechit_X"); - TTreeReaderArray hoRechitY(treeReader,"hoRechit_Y"); - TTreeReaderArray hoRechitZ(treeReader,"hoRechit_Z"); - TTreeReaderArray hoRechitEta(treeReader,"hoRechit_Eta"); - TTreeReaderArray hoRechitPhi(treeReader,"hoRechit_Phi"); - TTreeReaderArray hoRechitE(treeReader,"hoRechit_E"); - TTreeReaderArray hoRechitT(treeReader,"hoRechit_T"); + TTreeReaderArray hoRechitX(treeReader,"hoRechit_X"); + TTreeReaderArray hoRechitY(treeReader,"hoRechit_Y"); + TTreeReaderArray hoRechitZ(treeReader,"hoRechit_Z"); + TTreeReaderArray hoRechitEta(treeReader,"hoRechit_Eta"); + TTreeReaderArray hoRechitPhi(treeReader,"hoRechit_Phi"); + TTreeReaderArray hoRechitE(treeReader,"hoRechit_E"); + TTreeReaderArray hoRechitT(treeReader,"hoRechit_T"); */ TTreeReaderValue nLeptons(treeReader,"nLeptons"); //TTreeReaderValue nMuons(treeReader,"nMuons"); @@ -485,519 +487,519 @@ void analyzeSignal_ABCD(){ _ofile->cd(); totalNum += treeReader.GetEntries(1); while(treeReader.Next()){ - if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } - passFullVeto_clusterCR = false; - passRPCMatch_clusterCR = false; - passRPCSpread_clusterCR = false; - passRPCBx_clusterCR = false; - passMaxStation_clusterCR = false; - passLepton_clusterCR = false; - pass50Hits_clusterCR = false; - pass25Hits_clusterCR = false; - passFullVeto_rpcCR = false; - passRPCCR = false; - passClusterMET_rpcCR = false; - passMaxStation_rpcCR = false; - passJetMET_rpcCR = false; - passLepton_rpcCR = false; - pass50Hits_rpcCR = false; - pass25Hits_rpcCR = false; - nWheels1=0; - nWheels25=0; - nWheels50=0; - nStations1=0; - nStations25=0; - nStations50=0; - hitStation1=0; - hitStation2=0; - hitStation3=0; - hitStation4=0; - hitWheelm2=0; - hitWheelm1=0; - hitWheel0=0; - hitWheel1=0; - hitWheel2=0; - - nRPCWheels1=0; - nRPCWheels5=0; - nRPCWheels10=0; - nRPCStations1=0; - nRPCStations5=0; - nRPCStations10=0; - hitRPCStation1=0; - hitRPCStation2=0; - hitRPCStation3=0; - hitRPCStation4=0; - hitRPCWheelm2=0; - hitRPCWheelm1=0; - hitRPCWheel0=0; - hitRPCWheel1=0; - hitRPCWheel2=0; - - maxClusterSize=0; - - if(*MET > 200){ - dPhi_min = 999.; - dPhiClusterMET = 0.0; - dPhiClusterMET_max = 0.0; - if(*nDtRechitClusters>0){ - nPassNoVeto+=1; - for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } - if(dtRechitClusterSize[itr_clust]>maxClusterSize){ maxClusterSize = dtRechitClusterSize[itr_clust]; } - } - for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ - if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ - dPhi_tmp = jetPhi[itr_jet] - *METphi; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp) < dPhi_min){ - dPhi_min = fabs(dPhi_tmp); - } - } - } - } - if(fabs(dPhiClusterMET)<1.0){ nPassClusterCR+=1; } - - for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ - if(dtRechitClusterSize[itr_clust]>50){ - passMuon=false; - passMuon_alt=false; - passJet=false; - rpcBx.clear(); - rpcSpread = 99; - rpcMedian = 99; - dPhiClusterRPC = -0.1; - dZClusterRPC = -1.; - nStations25 = 0; - nStations50 = 0; - hoMatchedEnergy = 0.; - - dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; - if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } - if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } - - if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } - if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } - if(*nLeptons==0){ passMuon_alt = true; } - - /*passMB1 = false; - for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ - dPhi_tmp = hoRechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(hoRechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ - hoMatchedEnergy+=hoRechitE[itr_ho]; - } - } - if(hoMatchedEnergy>40.0){ passMB1 = true; } - */ - passMB1 = true; - for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ - if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ - dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ - passMB1 = false; - break; - } - } - /*if(itr_clust==0 && *nDtRechits<750){ - dtStation=getStation(dtRechitX[itr_dt],dtRechitY[itr_dt]); - dtWheel=getWheel(dtRechitZ[itr_dt]); - if(dtStation==1){ hitStation1+=1; } - else if(dtStation==2){ hitStation2+=1; } - else if(dtStation==3){ hitStation3+=1; } - else if(dtStation==4){ hitStation4+=1; } - if(dtWheel==-2){ hitWheelm2+=1; } - else if(dtWheel==-1){ hitWheelm1+=1; } - else if(dtWheel==0){ hitWheel0+=1; } - else if(dtWheel==1){ hitWheel1+=1; } - else if(dtWheel==2){ hitWheel2+=1; } - }*/ - } - if(itr_clust==0){ - if(hitStation1>0){ - nStations1+=1; - if(hitStation1>25){ - nStations25+=1; - if(hitStation1>50){ - nStations50+=1; - } - } - } - if(hitStation2>0){ - nStations1+=1; - if(hitStation2>25){ - nStations25+=1; - if(hitStation2>50){ - nStations50+=1; - } - } - } - if(hitStation3>0){ - nStations1+=1; - if(hitStation3>25){ - nStations25+=1; - if(hitStation3>50){ - nStations50+=1; - } - } - } - if(hitStation4>0){ - nStations1+=1; - if(hitStation4>25){ - nStations25+=1; - if(hitStation4>50){ - nStations50+=1; - } - } - } - if(hitWheel1>0){ - nWheels1+=1; - if(hitWheel1>25){ - nWheels25+=1; - if(hitWheel1>50){ - nWheels50+=1; - } - } - } - if(hitWheel2>0){ - nWheels1+=1; - if(hitWheel2>25){ - nWheels25+=1; - if(hitWheel2>50){ - nWheels50+=1; - } - } - } - if(hitWheel0>0){ - nWheels1+=1; - if(hitWheel0>25){ - nWheels25+=1; - if(hitWheel0>50){ - nWheels50+=1; - } - } - } - if(hitWheelm1>0){ - nWheels1+=1; - if(hitWheelm1>25){ - nWheels25+=1; - if(hitWheelm1>50){ - nWheels50+=1; - } - } - } - if(hitWheelm2>0){ - nWheels1+=1; - if(hitWheelm2>25){ - nWheels25+=1; - if(hitWheelm2>50){ - nWheels50+=1; - } - } - } - } - /*if(*nDtRechits>=750){ - nStations1=4; - nStations25=4; - nStations50=4; - nWheels1=5; - nWheels25=5; - nWheels50=5; - }*/ - if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } - - //cout << "doing rpc" << endl; - for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ - dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; - if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } - if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } - if(fabs(dPhi_tmp)0){ passRPCCR=true; } - if(itr_clust==0){ - if(hitRPCStation1>0){ - nRPCStations1+=1; - if(hitRPCStation1>5){ - nRPCStations5+=1; - if(hitRPCStation1>10){ - nRPCStations10+=1; - } - } - } - if(hitRPCStation2>0){ - nRPCStations1+=1; - if(hitRPCStation2>5){ - nRPCStations5+=1; - if(hitRPCStation2>10){ - nRPCStations10+=1; - } - } - } - if(hitRPCStation3>0){ - nRPCStations1+=1; - if(hitRPCStation3>5){ - nRPCStations5+=1; - if(hitRPCStation3>10){ - nRPCStations10+=1; - } - } - } - if(hitRPCStation4>0){ - nRPCStations1+=1; - if(hitRPCStation4>5){ - nRPCStations5+=1; - if(hitRPCStation4>10){ - nRPCStations10+=1; - } - } - } - if(hitRPCWheel1>0){ - nRPCWheels1+=1; - if(hitRPCWheel1>5){ - nRPCWheels5+=1; - if(hitRPCWheel1>10){ - nRPCWheels10+=1; - } - } - } - if(hitRPCWheel2>0){ - nRPCWheels1+=1; - if(hitRPCWheel2>5){ - nRPCWheels5+=1; - if(hitRPCWheel2>10){ - nRPCWheels10+=1; - } - } - } - if(hitRPCWheel0>0){ - nRPCWheels1+=1; - if(hitRPCWheel0>5){ - nRPCWheels5+=1; - if(hitRPCWheel0>10){ - nRPCWheels10+=1; - } - } - } - if(hitRPCWheelm1>0){ - nRPCWheels1+=1; - if(hitRPCWheelm1>5){ - nRPCWheels5+=1; - if(hitRPCWheelm1>10){ - nRPCWheels10+=1; - } - } - } - if(hitRPCWheelm2>0){ - nRPCWheels1+=1; - if(hitRPCWheelm2>5){ - nRPCWheels5+=1; - if(hitRPCWheelm2>10){ - nRPCWheels10+=1; - } - } - } - } - /*if(*nRPCRechits>750){ - nRPCStations1=4; - nRPCStations5=4; - nRPCStations10=4; - nRPCWheels1=5; - nRPCWheels5=5; - nRPCWheels10=5; - }*/ - - if(passJet && passMB1){ - - if(fabs(dPhiClusterMET)<1.0 && passMuon){ - passFullVeto_clusterCR=true; - h_nRPCMatched_fullVeto_clusterMETCR[itr_mX]->Fill(rpcBx.size()); - h_rpcSpread_fullVeto_clusterMETCR[itr_mX]->Fill(rpcSpread); - h_rpcBx_fullVeto_clusterMETCR[itr_mX]->Fill(rpcMedian); - h_dPhiJetMET_fullVeto_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); - h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); - - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation_clusterCR=true; - if(!rpcBx.empty()){ - passRPCMatch_clusterCR=true; - if(rpcSpread==0){ - passRPCSpread_clusterCR=true; - if(rpcMedian>=0.){ - passRPCBx_clusterCR=true; - if(*nLeptons==0){ - passLepton_clusterCR=true; - if(nStations50<3 && nWheels50<3){ - pass50Hits_clusterCR=true; - if(nStations25<3 && nWheels25<3){ - pass25Hits_clusterCR=true; - } - } - } - } - } - } - } - - if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); } - if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dPhiJetMET_Nminus1_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); } - if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_mX]->Fill(rpcMedian); } - if(!rpcBx.empty() && rpcMedian>=0. && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcSpread_Nminus1_clusterMETCR[itr_mX]->Fill(rpcSpread); } - if(dtRechitClusterMaxStation[itr_clust]>2){ h_nRPCMatched_Nminus1_clusterMETCR[itr_mX]->Fill(rpcBx.size()); } - } - - if(!rpcBx.empty() && rpcSpread==0 && passMuon){ - passFullVeto_rpcCR=true; - h_dPhiClusterMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); - h_dPhiJetMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); - h_dtRechitClusterMaxStation_fullVeto_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); - - if(dtRechitClusterMaxStation[itr_clust]>2){ - passMaxStation_rpcCR=true; - h_dPhiClusterMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); - h_dPhiJetMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); - if(fabs(dPhiClusterMET)<1.0){ - passClusterMET_rpcCR=true; - if(fabs(dPhi_min)>0.6){ - passJetMET_rpcCR=true; - if(*nLeptons==0){ - passLepton_rpcCR=true; - if(nStations50<3 && nWheels50<3){ - pass50Hits_rpcCR=true; - if(nStations25<4 && nWheels25<3){ - pass25Hits_rpcCR=true; - } - } - } - } - } - } - if(fabs(dPhiClusterMET)<1.0){ - h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); - } - } - - if(passMuon){ - if(!rpcBx.empty() && rpcSpread==0){ - if(rpcMedian>=0.){ - if(dtRechitClusterMaxStation[itr_clust]>2){ - if(fabs(dPhi_min)>0.6){ - if(fabs(dPhiClusterMET)<1.0){ - if(*nLeptons==0){ - if(nStations50<3 && nWheels50<3){ - if(nStations25<4 && nWheels25<3){ - h_dtRechitClusterSize_signalRegion[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_fullSelection_rpcCR[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); - h_dtRechitClusterSize_fullSelection_clusterMETCR[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); - } - } - } - } - } - } - } - } - } - - } - } - } - } - if(passFullVeto_clusterCR){ nPassFullVeto_clusterCR+=1; } - if(passRPCMatch_clusterCR){ nPassRPCMatch_clusterCR+=1; } - if(passRPCSpread_clusterCR){ nPassRPCSpread_clusterCR+=1; } - if(passRPCBx_clusterCR){ nPassRPCBx_clusterCR+=1; } - if(passMaxStation_clusterCR){ - nPassMaxStation_clusterCR+=1; - if(maxClusterSize>150){ - h_nStations1_150hits_clusterMETCR[itr_mX]->Fill(nStations1); - h_nStations25_150hits_clusterMETCR[itr_mX]->Fill(nStations25); - h_nStations50_150hits_clusterMETCR[itr_mX]->Fill(nStations50); - h_nWheels1_150hits_clusterMETCR[itr_mX]->Fill(nWheels1); - h_nWheels25_150hits_clusterMETCR[itr_mX]->Fill(nWheels25); - h_nWheels50_150hits_clusterMETCR[itr_mX]->Fill(nWheels50); - - h_nRPCStations1_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); - h_nRPCStations5_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); - h_nRPCStations10_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); - h_nRPCWheels1_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); - h_nRPCWheels5_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); - h_nRPCWheels10_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); - } - else if(maxClusterSize>100){ - h_nStations1_100hits_clusterMETCR[itr_mX]->Fill(nStations1); - h_nStations25_100hits_clusterMETCR[itr_mX]->Fill(nStations25); - h_nStations50_100hits_clusterMETCR[itr_mX]->Fill(nStations50); - h_nWheels1_100hits_clusterMETCR[itr_mX]->Fill(nWheels1); - h_nWheels25_100hits_clusterMETCR[itr_mX]->Fill(nWheels25); - h_nWheels50_100hits_clusterMETCR[itr_mX]->Fill(nWheels50); - - h_nRPCStations1_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); - h_nRPCStations5_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); - h_nRPCStations10_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); - h_nRPCWheels1_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); - h_nRPCWheels5_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); - h_nRPCWheels10_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); - } - else{ - h_nStations1_50hits_clusterMETCR[itr_mX]->Fill(nStations1); - h_nStations25_50hits_clusterMETCR[itr_mX]->Fill(nStations25); - h_nStations50_50hits_clusterMETCR[itr_mX]->Fill(nStations50); - h_nWheels1_50hits_clusterMETCR[itr_mX]->Fill(nWheels1); - h_nWheels25_50hits_clusterMETCR[itr_mX]->Fill(nWheels25); - h_nWheels50_50hits_clusterMETCR[itr_mX]->Fill(nWheels50); - - h_nRPCStations1_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); - h_nRPCStations5_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); - h_nRPCStations10_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); - h_nRPCWheels1_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); - h_nRPCWheels5_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); - h_nRPCWheels10_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); - } - } - if(passLepton_clusterCR){ nPassLepton_clusterCR+=1; } - if(pass50Hits_clusterCR){ nPass50Hits_clusterCR+=1; } - if(pass25Hits_clusterCR){ nPass25Hits_clusterCR+=1; } - - if(passRPCCR){ nPassRPCCR+=1; } - if(passFullVeto_rpcCR){ nPassFullVeto_rpcCR+=1; } - if(passClusterMET_rpcCR){ nPassClusterMET_rpcCR+=1; } - if(passMaxStation_rpcCR){ nPassMaxStation_rpcCR+=1; } - if(passJetMET_rpcCR){ nPassJetMET_rpcCR+=1; } - if(passLepton_rpcCR){ nPassLepton_rpcCR+=1; } - if(pass50Hits_rpcCR){ nPass50Hits_rpcCR+=1; } - if(pass25Hits_rpcCR){ nPass25Hits_rpcCR+=1; } - evtNum+=1; + if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } + passFullVeto_clusterCR = false; + passRPCMatch_clusterCR = false; + passRPCSpread_clusterCR = false; + passRPCBx_clusterCR = false; + passMaxStation_clusterCR = false; + passLepton_clusterCR = false; + pass50Hits_clusterCR = false; + pass25Hits_clusterCR = false; + passFullVeto_rpcCR = false; + passRPCCR = false; + passClusterMET_rpcCR = false; + passMaxStation_rpcCR = false; + passJetMET_rpcCR = false; + passLepton_rpcCR = false; + pass50Hits_rpcCR = false; + pass25Hits_rpcCR = false; + nWheels1=0; + nWheels25=0; + nWheels50=0; + nStations1=0; + nStations25=0; + nStations50=0; + hitStation1=0; + hitStation2=0; + hitStation3=0; + hitStation4=0; + hitWheelm2=0; + hitWheelm1=0; + hitWheel0=0; + hitWheel1=0; + hitWheel2=0; + + nRPCWheels1=0; + nRPCWheels5=0; + nRPCWheels10=0; + nRPCStations1=0; + nRPCStations5=0; + nRPCStations10=0; + hitRPCStation1=0; + hitRPCStation2=0; + hitRPCStation3=0; + hitRPCStation4=0; + hitRPCWheelm2=0; + hitRPCWheelm1=0; + hitRPCWheel0=0; + hitRPCWheel1=0; + hitRPCWheel2=0; + + maxClusterSize=0; + + if(*MET > 200) { + dPhi_min = 999.; + dPhiClusterMET = 0.0; + dPhiClusterMET_max = 0.0; + if(*nDtRechitClusters>0){ + nPassNoVeto+=1; + for(Int_t itr_clust = 0; itr_clust<*nDtRechitClusters; itr_clust++){ + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + if(fabs(dPhiClusterMET)>dPhiClusterMET_max){ dPhiClusterMET_max=fabs(dPhiClusterMET); } + if(dtRechitClusterSize[itr_clust]>maxClusterSize){ maxClusterSize = dtRechitClusterSize[itr_clust]; } + } + for(Int_t itr_jet = 0; itr_jet<*nJets; itr_jet++){ + if(fabs(jetEta[itr_jet])<3.0 && jetPt[itr_jet]>30.0){ + dPhi_tmp = jetPhi[itr_jet] - *METphi; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp) < dPhi_min){ + dPhi_min = fabs(dPhi_tmp); + } + } + } + } + if(fabs(dPhiClusterMET)<1.0){ nPassClusterCR+=1; } + + for(Int_t itr_clust=0; itr_clust<*nDtRechitClusters; itr_clust++){ + if(dtRechitClusterSize[itr_clust]>50){ + passMuon=false; + passMuon_alt=false; + passJet=false; + rpcBx.clear(); + rpcSpread = 99; + rpcMedian = 99; + dPhiClusterRPC = -0.1; + dZClusterRPC = -1.; + nStations25 = 0; + nStations50 = 0; + hoMatchedEnergy = 0.; + + dPhiClusterMET = dtRechitClusterPhi[itr_clust] - *METphi; + if(dPhiClusterMET > TMath::Pi()){ dPhiClusterMET -= 2*TMath::Pi(); } + if(dPhiClusterMET < -1.0*TMath::Pi()){ dPhiClusterMET += 2*TMath::Pi(); } + + if(dtRechitClusterJetVetoPt[itr_clust]<20.){ passJet = true; } + if(dtRechitClusterMuonVetoPt[itr_clust]<10.){ passMuon = true; } + if(*nLeptons==0){ passMuon_alt = true; } + + /*passMB1 = false; + for(Int_t itr_ho = 0; itr_ho<*nHORechits; itr_ho++){ + dPhi_tmp = hoRechitPhi[itr_ho] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(hoRechitEta[itr_ho]-dtRechitClusterEta[itr_clust],2))<0.5){ + hoMatchedEnergy+=hoRechitE[itr_ho]; + } + } + if(hoMatchedEnergy>40.0){ passMB1 = true; } + */ + passMB1 = true; + for(Int_t itr_dt = 0; itr_dt<*nDtRechits; itr_dt++){ + if(sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))>400. && sqrt(pow(dtRechitX[itr_dt],2)+pow(dtRechitY[itr_dt],2))<480.){ + dPhi_tmp = dtRechitPhi[itr_dt] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(sqrt(pow(dPhi_tmp,2)+pow(dtRechitEta[itr_dt]-dtRechitClusterEta[itr_clust],2))<0.4){ + passMB1 = false; + break; + } + } + /*if(itr_clust==0 && *nDtRechits<750){ + dtStation=getStation(dtRechitX[itr_dt],dtRechitY[itr_dt]); + dtWheel=getWheel(dtRechitZ[itr_dt]); + if(dtStation==1){ hitStation1+=1; } + else if(dtStation==2){ hitStation2+=1; } + else if(dtStation==3){ hitStation3+=1; } + else if(dtStation==4){ hitStation4+=1; } + if(dtWheel==-2){ hitWheelm2+=1; } + else if(dtWheel==-1){ hitWheelm1+=1; } + else if(dtWheel==0){ hitWheel0+=1; } + else if(dtWheel==1){ hitWheel1+=1; } + else if(dtWheel==2){ hitWheel2+=1; } + }*/ + } + if(itr_clust==0){ + if(hitStation1>0){ + nStations1+=1; + if(hitStation1>25){ + nStations25+=1; + if(hitStation1>50){ + nStations50+=1; + } + } + } + if(hitStation2>0){ + nStations1+=1; + if(hitStation2>25){ + nStations25+=1; + if(hitStation2>50){ + nStations50+=1; + } + } + } + if(hitStation3>0){ + nStations1+=1; + if(hitStation3>25){ + nStations25+=1; + if(hitStation3>50){ + nStations50+=1; + } + } + } + if(hitStation4>0){ + nStations1+=1; + if(hitStation4>25){ + nStations25+=1; + if(hitStation4>50){ + nStations50+=1; + } + } + } + if(hitWheel1>0){ + nWheels1+=1; + if(hitWheel1>25){ + nWheels25+=1; + if(hitWheel1>50){ + nWheels50+=1; + } + } + } + if(hitWheel2>0){ + nWheels1+=1; + if(hitWheel2>25){ + nWheels25+=1; + if(hitWheel2>50){ + nWheels50+=1; + } + } + } + if(hitWheel0>0){ + nWheels1+=1; + if(hitWheel0>25){ + nWheels25+=1; + if(hitWheel0>50){ + nWheels50+=1; + } + } + } + if(hitWheelm1>0){ + nWheels1+=1; + if(hitWheelm1>25){ + nWheels25+=1; + if(hitWheelm1>50){ + nWheels50+=1; + } + } + } + if(hitWheelm2>0){ + nWheels1+=1; + if(hitWheelm2>25){ + nWheels25+=1; + if(hitWheelm2>50){ + nWheels50+=1; + } + } + } + } + /*if(*nDtRechits>=750){ + nStations1=4; + nStations25=4; + nStations50=4; + nWheels1=5; + nWheels25=5; + nWheels50=5; + }*/ + if(dtRechitClusterNSegmentStation1[itr_clust]>0){ passMB1 = false; } + + //cout << "doing rpc" << endl; + for(Int_t itr_rpc=0; itr_rpc<*nRPCRechits; itr_rpc++){ + dPhi_tmp = RPCRechitPhi[itr_rpc] - dtRechitClusterPhi[itr_clust]; + if(dPhi_tmp > TMath::Pi()){ dPhi_tmp -= 2*TMath::Pi(); } + if(dPhi_tmp < -1.0*TMath::Pi()){ dPhi_tmp += 2*TMath::Pi(); } + if(fabs(dPhi_tmp)0){ passRPCCR=true; } + if(itr_clust==0){ + if(hitRPCStation1>0){ + nRPCStations1+=1; + if(hitRPCStation1>5){ + nRPCStations5+=1; + if(hitRPCStation1>10){ + nRPCStations10+=1; + } + } + } + if(hitRPCStation2>0){ + nRPCStations1+=1; + if(hitRPCStation2>5){ + nRPCStations5+=1; + if(hitRPCStation2>10){ + nRPCStations10+=1; + } + } + } + if(hitRPCStation3>0){ + nRPCStations1+=1; + if(hitRPCStation3>5){ + nRPCStations5+=1; + if(hitRPCStation3>10){ + nRPCStations10+=1; + } + } + } + if(hitRPCStation4>0){ + nRPCStations1+=1; + if(hitRPCStation4>5){ + nRPCStations5+=1; + if(hitRPCStation4>10){ + nRPCStations10+=1; + } + } + } + if(hitRPCWheel1>0){ + nRPCWheels1+=1; + if(hitRPCWheel1>5){ + nRPCWheels5+=1; + if(hitRPCWheel1>10){ + nRPCWheels10+=1; + } + } + } + if(hitRPCWheel2>0){ + nRPCWheels1+=1; + if(hitRPCWheel2>5){ + nRPCWheels5+=1; + if(hitRPCWheel2>10){ + nRPCWheels10+=1; + } + } + } + if(hitRPCWheel0>0){ + nRPCWheels1+=1; + if(hitRPCWheel0>5){ + nRPCWheels5+=1; + if(hitRPCWheel0>10){ + nRPCWheels10+=1; + } + } + } + if(hitRPCWheelm1>0){ + nRPCWheels1+=1; + if(hitRPCWheelm1>5){ + nRPCWheels5+=1; + if(hitRPCWheelm1>10){ + nRPCWheels10+=1; + } + } + } + if(hitRPCWheelm2>0){ + nRPCWheels1+=1; + if(hitRPCWheelm2>5){ + nRPCWheels5+=1; + if(hitRPCWheelm2>10){ + nRPCWheels10+=1; + } + } + } + } + /*if(*nRPCRechits>750){ + nRPCStations1=4; + nRPCStations5=4; + nRPCStations10=4; + nRPCWheels1=5; + nRPCWheels5=5; + nRPCWheels10=5; + }*/ + + if(passJet && passMB1){ + + if(fabs(dPhiClusterMET)<1.0 && passMuon){ + passFullVeto_clusterCR=true; + h_nRPCMatched_fullVeto_clusterMETCR[itr_mX]->Fill(rpcBx.size()); + h_rpcSpread_fullVeto_clusterMETCR[itr_mX]->Fill(rpcSpread); + h_rpcBx_fullVeto_clusterMETCR[itr_mX]->Fill(rpcMedian); + h_dPhiJetMET_fullVeto_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); + h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); + + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation_clusterCR=true; + if(!rpcBx.empty()){ + passRPCMatch_clusterCR=true; + if(rpcSpread==0){ + passRPCSpread_clusterCR=true; + if(rpcMedian>=0.){ + passRPCBx_clusterCR=true; + if(*nLeptons==0){ + passLepton_clusterCR=true; + if(nStations50<3 && nWheels50<3){ + pass50Hits_clusterCR=true; + if(nStations25<3 && nWheels25<3){ + pass25Hits_clusterCR=true; + } + } + } + } + } + } + } + + if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); } + if(!rpcBx.empty() && rpcSpread==0 && rpcMedian>=0.){ h_dPhiJetMET_Nminus1_clusterMETCR[itr_mX]->Fill(fabs(dPhi_min)); } + if(!rpcBx.empty() && rpcSpread==0 && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcBx_Nminus1_clusterMETCR[itr_mX]->Fill(rpcMedian); } + if(!rpcBx.empty() && rpcMedian>=0. && dtRechitClusterMaxStation[itr_clust]>2){ h_rpcSpread_Nminus1_clusterMETCR[itr_mX]->Fill(rpcSpread); } + if(dtRechitClusterMaxStation[itr_clust]>2){ h_nRPCMatched_Nminus1_clusterMETCR[itr_mX]->Fill(rpcBx.size()); } + } + + if(!rpcBx.empty() && rpcSpread==0 && passMuon){ + passFullVeto_rpcCR=true; + h_dPhiClusterMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); + h_dPhiJetMET_fullVeto_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); + h_dtRechitClusterMaxStation_fullVeto_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); + + if(dtRechitClusterMaxStation[itr_clust]>2){ + passMaxStation_rpcCR=true; + h_dPhiClusterMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhiClusterMET)); + h_dPhiJetMET_Nminus1_rpcCR[itr_mX]->Fill(fabs(dPhi_min)); + if(fabs(dPhiClusterMET)<1.0){ + passClusterMET_rpcCR=true; + if(fabs(dPhi_min)>0.6){ + passJetMET_rpcCR=true; + if(*nLeptons==0){ + passLepton_rpcCR=true; + if(nStations50<3 && nWheels50<3){ + pass50Hits_rpcCR=true; + if(nStations25<4 && nWheels25<3){ + pass25Hits_rpcCR=true; + } + } + } + } + } + } + if(fabs(dPhiClusterMET)<1.0){ + h_dtRechitClusterMaxStation_Nminus1_rpcCR[itr_mX]->Fill(dtRechitClusterMaxStation[itr_clust]); + } + } + + if(passMuon){ + if(!rpcBx.empty() && rpcSpread==0){ + if(rpcMedian>=0.){ + if(dtRechitClusterMaxStation[itr_clust]>2){ + if(fabs(dPhi_min)>0.6){ + if(fabs(dPhiClusterMET)<1.0){ + if(*nLeptons==0){ + if(nStations50<3 && nWheels50<3){ + if(nStations25<4 && nWheels25<3){ + h_dtRechitClusterSize_signalRegion[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_fullSelection_rpcCR[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); + h_dtRechitClusterSize_fullSelection_clusterMETCR[itr_mX]->Fill(dtRechitClusterSize[itr_clust]); + } + } + } + } + } + } + } + } + } + + } + } + } + } + if(passFullVeto_clusterCR){ nPassFullVeto_clusterCR+=1; } + if(passRPCMatch_clusterCR){ nPassRPCMatch_clusterCR+=1; } + if(passRPCSpread_clusterCR){ nPassRPCSpread_clusterCR+=1; } + if(passRPCBx_clusterCR){ nPassRPCBx_clusterCR+=1; } + if(passMaxStation_clusterCR){ + nPassMaxStation_clusterCR+=1; + if(maxClusterSize>150){ + h_nStations1_150hits_clusterMETCR[itr_mX]->Fill(nStations1); + h_nStations25_150hits_clusterMETCR[itr_mX]->Fill(nStations25); + h_nStations50_150hits_clusterMETCR[itr_mX]->Fill(nStations50); + h_nWheels1_150hits_clusterMETCR[itr_mX]->Fill(nWheels1); + h_nWheels25_150hits_clusterMETCR[itr_mX]->Fill(nWheels25); + h_nWheels50_150hits_clusterMETCR[itr_mX]->Fill(nWheels50); + + h_nRPCStations1_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); + h_nRPCStations5_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); + h_nRPCStations10_150hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); + h_nRPCWheels1_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); + h_nRPCWheels5_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); + h_nRPCWheels10_150hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); + } + else if(maxClusterSize>100){ + h_nStations1_100hits_clusterMETCR[itr_mX]->Fill(nStations1); + h_nStations25_100hits_clusterMETCR[itr_mX]->Fill(nStations25); + h_nStations50_100hits_clusterMETCR[itr_mX]->Fill(nStations50); + h_nWheels1_100hits_clusterMETCR[itr_mX]->Fill(nWheels1); + h_nWheels25_100hits_clusterMETCR[itr_mX]->Fill(nWheels25); + h_nWheels50_100hits_clusterMETCR[itr_mX]->Fill(nWheels50); + + h_nRPCStations1_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); + h_nRPCStations5_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); + h_nRPCStations10_100hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); + h_nRPCWheels1_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); + h_nRPCWheels5_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); + h_nRPCWheels10_100hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); + } + else{ + h_nStations1_50hits_clusterMETCR[itr_mX]->Fill(nStations1); + h_nStations25_50hits_clusterMETCR[itr_mX]->Fill(nStations25); + h_nStations50_50hits_clusterMETCR[itr_mX]->Fill(nStations50); + h_nWheels1_50hits_clusterMETCR[itr_mX]->Fill(nWheels1); + h_nWheels25_50hits_clusterMETCR[itr_mX]->Fill(nWheels25); + h_nWheels50_50hits_clusterMETCR[itr_mX]->Fill(nWheels50); + + h_nRPCStations1_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations1); + h_nRPCStations5_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations5); + h_nRPCStations10_50hits_clusterMETCR[itr_mX]->Fill(nRPCStations10); + h_nRPCWheels1_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels1); + h_nRPCWheels5_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels5); + h_nRPCWheels10_50hits_clusterMETCR[itr_mX]->Fill(nRPCWheels10); + } + } + if(passLepton_clusterCR){ nPassLepton_clusterCR+=1; } + if(pass50Hits_clusterCR){ nPass50Hits_clusterCR+=1; } + if(pass25Hits_clusterCR){ nPass25Hits_clusterCR+=1; } + + if(passRPCCR){ nPassRPCCR+=1; } + if(passFullVeto_rpcCR){ nPassFullVeto_rpcCR+=1; } + if(passClusterMET_rpcCR){ nPassClusterMET_rpcCR+=1; } + if(passMaxStation_rpcCR){ nPassMaxStation_rpcCR+=1; } + if(passJetMET_rpcCR){ nPassJetMET_rpcCR+=1; } + if(passLepton_rpcCR){ nPassLepton_rpcCR+=1; } + if(pass50Hits_rpcCR){ nPass50Hits_rpcCR+=1; } + if(pass25Hits_rpcCR){ nPass25Hits_rpcCR+=1; } + evtNum+=1; } } diff --git a/signalfiles.h b/signalfiles.h new file mode 100644 index 0000000..d012646 --- /dev/null +++ b/signalfiles.h @@ -0,0 +1,28 @@ +#include +#include +#include + +#include "TH1D.h" +#include "TFile.h" +#include "TH2D.h" +#include "TFile.h" + +#include "TMath.h" +#include "TTreeReaderValue.h" +#include "TTreeReaderArray.h" +#include "TTreeReader.h" +#include +#include +#include "TString.h" + +std::vector signalfiles = { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" +}; + +std::vector skimsignalfiles = { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root" +}; diff --git a/skim.C b/skim.C new file mode 100644 index 0000000..66b0033 --- /dev/null +++ b/skim.C @@ -0,0 +1,25 @@ +#include "TChain.h" +#include "TFile.h" +#include "TTree.h" +#include +#include // std::max +#include + +void skim() +{ + std::vector signalfiles = { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted" + }; + + for (unsigned i = 0; i < signalfiles.size(); i++) { + TChain* chain = new TChain("MuonSystem"); + chain->Add(TString(signalfiles[i]) + ".root"); + + TFile* newFile = TFile::Open(TString(signalfiles[i]) + "_skim.root", "RECREATE"); + TTree* newChain = chain->CopyTree("met>=200"); + newChain->AutoSave(); + newFile->Close(); + } +} From 3124e9d76080780fe15b87972701f90bfa22cbdc Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 18:34:28 -0500 Subject: [PATCH 12/15] copy files --- .gitignore | 3 ++- analyzeSignal_ABCD.C | 8 +++++++- copyfiles.sh | 22 +++++++++++++++++++++ datafiles.h | 6 +++--- signalfiles.h | 46 ++++++++++++++++++++++++++++++++++++-------- skim.sh | 7 +++++++ 6 files changed, 79 insertions(+), 13 deletions(-) create mode 100755 copyfiles.sh create mode 100755 skim.sh diff --git a/.gitignore b/.gitignore index 4bed096..8ac3370 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ *.pcm -*.C~ \ No newline at end of file +*.C~ +*.sh~ \ No newline at end of file diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 1c1d045..eab9b3f 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -407,11 +407,16 @@ void analyzeSignal_ABCD(){ TFile *_file; if(strcmp(years[itr_year],"MC_Summer16")==0){ _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); + cout << dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8\ +_1pb_weighted.root" << endl; } else{ // _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - _file = TFile::Open(TString(skimsignalfiles[itr_year])); + cout << dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" << endl; + // cout << "Opening " << TString(skimsignalfiles[itr_year]) << endl; + // _file = TFile::Open(TString(skimsignalfiles[itr_year])); } + continue; TTreeReader treeReader("MuonSystem",_file); @@ -486,6 +491,7 @@ void analyzeSignal_ABCD(){ _ofile->cd(); totalNum += treeReader.GetEntries(1); + cout << "Processing " << totalNum << " entries" << endl; while(treeReader.Next()){ if(evtNum%100000==0){ cout << evtNum << " of " << totalNum << endl; } passFullVeto_clusterCR = false; diff --git a/copyfiles.sh b/copyfiles.sh new file mode 100755 index 0000000..2fbeda0 --- /dev/null +++ b/copyfiles.sh @@ -0,0 +1,22 @@ +#!/usr/bin/bash + +## copy the files over +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall18/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall18 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall17/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall17 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Summer16/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Summer16 + + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall18/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall18 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall17/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall17 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Summer16/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Summer16 + + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall18/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall18 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Fall17/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Fall17 + +xrdcp root://cmsxrootd.fnal.gov//store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/MC_Summer16/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root /eos/uscms/store/user/dildick/delayedjetsanalysis/MC_Summer16 diff --git a/datafiles.h b/datafiles.h index e0e8afb..3f95c1f 100644 --- a/datafiles.h +++ b/datafiles.h @@ -16,7 +16,7 @@ #include "TString.h" std::vector datafiles = { - "Run2_displacedJetMuonNtupler_V1p17_Data2018_17Sept2018_Run2018-HighMET-17Sep2018_goodLumi.root", - "Run2_displacedJetMuonNtupler_V1p17_Data2017_Run2017-HighMET-17Nov2017_goodLumi.root", - "Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root" + "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2018_17Sept2018_Run2018-HighMET-17Sep2018_goodLumi.root", + "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2017_Run2017-HighMET-17Nov2017_goodLumi.root", + "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root" }; diff --git a/signalfiles.h b/signalfiles.h index d012646..38eefc0 100644 --- a/signalfiles.h +++ b/signalfiles.h @@ -15,14 +15,44 @@ #include #include "TString.h" -std::vector signalfiles = { - "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", - "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", - "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" +std::map > signalfiles = { + {"MC_Summer16", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" + } + }, + {"MC_Fall17", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" + } + }, + {"MC_Fall18", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" + } + } }; -std::vector skimsignalfiles = { - "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root", - "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root", - "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted_skim.root" +std::map > skimsignalfiles = { + {"MC_Summer16", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root" + } + }, + {"MC_Fall17", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root" + } + }, + {"MC_Fall18", { + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root" + } + } }; diff --git a/skim.sh b/skim.sh new file mode 100755 index 0000000..fe2fae2 --- /dev/null +++ b/skim.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' + +python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' + +python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' From 595ee17ffb8a2cebcb69fcf5f029e598a3a49ec3 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 19:24:47 -0500 Subject: [PATCH 13/15] update skim file --- analyzeSignal_ABCD.C | 17 ++++------------- skim.sh | 37 ++++++++++++++++++++++++++++++++++--- skimAllRelevantEvents.py | 2 +- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index eab9b3f..2e0459b 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -30,6 +30,9 @@ void analyzeSignal_ABCD(){ if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } + // location of files on EOSLPC + fsPreFix += "/store/user/dildick/delayedjetsanalysis/" + char name[50]; char title[100]; char mX[3][10] = {"15","40","55"}; @@ -404,19 +407,7 @@ void analyzeSignal_ABCD(){ for(Int_t itr_year = 0; itr_year<3; itr_year++){ cout << " " << years[itr_year] << endl; - TFile *_file; - if(strcmp(years[itr_year],"MC_Summer16")==0){ - _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root"); - cout << dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCUETP8M1_13TeV-powheg-pythia8\ -_1pb_weighted.root" << endl; - } - else{ - // _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root"); - cout << dir+years[itr_year]+"/v1/v3/normalized/ggH_HToSSTobbbb_MH-125_MS-"+mX[itr_mX]+"_ctau-"+ctau+"_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" << endl; - // cout << "Opening " << TString(skimsignalfiles[itr_year]) << endl; - // _file = TFile::Open(TString(skimsignalfiles[itr_year])); - } - continue; + TFile *_file = TFile::Open(fsPreFix + TString(skimsignalfiles[itr_year])); TTreeReader treeReader("MuonSystem",_file); diff --git a/skim.sh b/skim.sh index fe2fae2..49f93bb 100755 --- a/skim.sh +++ b/skim.sh @@ -1,7 +1,38 @@ #!/usr/bin/bash -python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' +## script to skim all MC for MET > 200 GeV +cutstring='met>200' -python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' +runTest=false +prefix="root://cmseos.fnal.gov/" +signalpath="/store/user/dildick/delayedjetsanalysis/" +alias eosls="eos root://cmseos.fnal.gov ls" -python skimAllRelevantEvents.py ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root 'met>200' +output=$(eos root://cmseos.fnal.gov ls $signalpath | grep MC) +echo $output + +for x in $output; +do + echo $signalpath/$x + fileoutput=$(eos root://cmseos.fnal.gov ls $signalpath/$x) + for y in $fileoutput; + do + fullpath=$signalpath/$x + ## replace root with skim.root + firstString=".root" + secondString=".skim.root" + newy=${y/$firstString/$secondString} + + if [ "$runTest" = true ] ; then + echo Running Test + echo python skimAllRelevantEvents.py $prefix$fullpath/$y $newy $cutstring; + echo xrdcp $newy $prefix$fullpath/; + echo rm $newy; + else + echo Skimming Files + python skimAllRelevantEvents.py $prefix$fullpath/$y $newy $cutstring; + xrdcp $newy $prefix$fullpath/; + rm $newy; + fi + done; +done; diff --git a/skimAllRelevantEvents.py b/skimAllRelevantEvents.py index 6e0e72d..63497c6 100644 --- a/skimAllRelevantEvents.py +++ b/skimAllRelevantEvents.py @@ -9,7 +9,7 @@ def makeSkim(inputFile,outputFile,cutString,test=False): if inputFile == outputFile: print "DON'T OVERWRITE THE INPUT!" exit() - inputFile = r.TFile(inputFile) + inputFile = r.TFile.Open(inputFile) tree = inputFile.Get("MuonSystem") if test: tree.Draw(">>eList",cutString,"entryList",1000); From c7c2674db9b0aa5ef37ac9283f5f2e16e246dc81 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 20:29:49 -0500 Subject: [PATCH 14/15] Fix 16 tune --- analyzeSignal_ABCD.C | 5 +++-- signalfiles.h | 14 +++++++------- skim.sh | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/analyzeSignal_ABCD.C b/analyzeSignal_ABCD.C index 2e0459b..9e0a5c5 100644 --- a/analyzeSignal_ABCD.C +++ b/analyzeSignal_ABCD.C @@ -31,7 +31,7 @@ void analyzeSignal_ABCD(){ } // location of files on EOSLPC - fsPreFix += "/store/user/dildick/delayedjetsanalysis/" + fsPreFix += "/store/user/dildick/delayedjetsanalysis/"; char name[50]; char title[100]; @@ -406,8 +406,9 @@ void analyzeSignal_ABCD(){ cout << mX[itr_mX] << "_" << ctau << endl; for(Int_t itr_year = 0; itr_year<3; itr_year++){ cout << " " << years[itr_year] << endl; + cout << fsPreFix + years[itr_year] + "/" + (skimsignalfiles[years[itr_year]])[itr_mX] << endl; - TFile *_file = TFile::Open(fsPreFix + TString(skimsignalfiles[itr_year])); + TFile *_file = TFile::Open(fsPreFix + years[itr_year] + "/" + (skimsignalfiles[years[itr_year]])[itr_mX]); TTreeReader treeReader("MuonSystem",_file); diff --git a/signalfiles.h b/signalfiles.h index 38eefc0..8d2b524 100644 --- a/signalfiles.h +++ b/signalfiles.h @@ -17,9 +17,9 @@ std::map > signalfiles = { {"MC_Summer16", { - "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", - "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root", - "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.root" + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.root" } }, {"MC_Fall17", { @@ -36,11 +36,11 @@ std::map > signalfiles = { } }; -std::map > skimsignalfiles = { +std::map > skimsignalfiles = { {"MC_Summer16", { - "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", - "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root", - "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCP5_13TeV-powheg-pythia8_1pb_weighted.skim.root" + "ggH_HToSSTobbbb_MH-125_MS-15_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-40_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.skim.root", + "ggH_HToSSTobbbb_MH-125_MS-55_ctau-1000_TuneCUETP8M1_13TeV-powheg-pythia8_1pb_weighted.skim.root" } }, {"MC_Fall17", { diff --git a/skim.sh b/skim.sh index 49f93bb..760b945 100755 --- a/skim.sh +++ b/skim.sh @@ -8,7 +8,7 @@ prefix="root://cmseos.fnal.gov/" signalpath="/store/user/dildick/delayedjetsanalysis/" alias eosls="eos root://cmseos.fnal.gov ls" -output=$(eos root://cmseos.fnal.gov ls $signalpath | grep MC) +output=$(eos root://cmseos.fnal.gov ls $signalpath | grep MC_Summer16) echo $output for x in $output; From e0b6cdff1fd2bc0a1745d0ec1de5ff9260bf6cc0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Oct 2020 20:41:49 -0500 Subject: [PATCH 15/15] fix data analysis --- analyzeData_ABCD.C | 8 ++++---- datafiles.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/analyzeData_ABCD.C b/analyzeData_ABCD.C index 6ad0fd8..dc28c2f 100644 --- a/analyzeData_ABCD.C +++ b/analyzeData_ABCD.C @@ -16,13 +16,14 @@ void analyzeData_ABCD(){ if (useCERN) fsPreFix = "root://cms-xrd-global.cern.ch//"; } + fsPreFix += "/store/user/dildick/delayedjetsanalysis/Data/"; + char name[50]; char title[100]; char years[4][10] = {"2018","2017","2016"}; char runNames[3][20] = {"17Sept2018_Run2018","Run2017","Run2016"}; char dates[3][20] = {"17Sep2018","17Nov2017","07Aug17"}; TString dir(fsPreFix + "/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data"); - //TString dir("/storage/user/mcitron/skims/"); TFile *_ofile = TFile::Open("outData_ABCD.root","RECREATE"); TH1D *h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto[4]; @@ -512,9 +513,8 @@ void analyzeData_ABCD(){ _file = TFile::Open(dir+years[itr_year]+"/v4/v4/normalized/Run2_displacedJetMuonNtupler_V1p15_Data2016_Data2017_Data2018-HighMET_goodLumi.root"); } else{ - _file = TFile::Open(TString(datafiles[itr_year])); - // _file = TFile::Open(dir+years[itr_year]+"/v1/v3/normalized/Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); - //_file = TFile::Open(dir+"Run2_displacedJetMuonNtupler_V1p17_Data"+years[itr_year]+"_"+runNames[itr_year]+"-HighMET-"+dates[itr_year]+"_goodLumi.root"); + cout << "Opening " << fsPreFix + TString(datafiles[itr_year]) << endl; + _file = TFile::Open(fsPreFix + TString(datafiles[itr_year])); } TTreeReader treeReader("MuonSystem",_file); diff --git a/datafiles.h b/datafiles.h index 3f95c1f..e0e8afb 100644 --- a/datafiles.h +++ b/datafiles.h @@ -16,7 +16,7 @@ #include "TString.h" std::vector datafiles = { - "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2018_17Sept2018_Run2018-HighMET-17Sep2018_goodLumi.root", - "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2017_Run2017-HighMET-17Nov2017_goodLumi.root", - "/store/user/dildick/delayedjetsanalysis/Data/Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root" + "Run2_displacedJetMuonNtupler_V1p17_Data2018_17Sept2018_Run2018-HighMET-17Sep2018_goodLumi.root", + "Run2_displacedJetMuonNtupler_V1p17_Data2017_Run2017-HighMET-17Nov2017_goodLumi.root", + "Run2_displacedJetMuonNtupler_V1p17_Data2016_Run2016-HighMET-07Aug17_goodLumi.root" };