Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs to run E/p in the master branch #86

Open
wants to merge 526 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
526 commits
Select commit Hold shift + click to select a range
1595912
added shell variable init scripts
Jan 22, 2014
718d4f3
removed obsolete server for crab cfg
Jan 22, 2014
a8060d4
from CMSSW_7_0_X PFiso included in standard sequences
Jan 22, 2014
6d5bd62
all
Jan 22, 2014
fe3d6bb
added instructions to load the init script
Jan 22, 2014
9a5fa88
updated doxygen documentation with alcareco and alcaraw production
Jan 22, 2014
9b2cdb4
fixed tutorial for rereco
Jan 22, 2014
697c422
Update README.md
Jan 22, 2014
553622a
removed patch in CMSSW_7_0_X
Jan 22, 2014
ff37113
Merge branch 'master' of github.com:ECALELFS/ECALELF
Jan 22, 2014
fab2beb
fixed path error in init script
Jan 23, 2014
bdfd016
Update README.md
Jan 23, 2014
1545cef
new rereco for test
Jan 23, 2014
4e86354
fixed obsolete server for crab
Jan 23, 2014
4b7c62b
Merge branch 'master' of github.com:ECALELFS/ECALELF
Jan 23, 2014
fdbfcd4
fixing value map traslator
Jan 23, 2014
49cce3e
fixed isCrab for local running
Jan 23, 2014
4803d29
fixing
Jan 23, 2014
4efd813
fixed
Jan 23, 2014
dbb1c43
updated rerecoes
Jan 23, 2014
d653bad
cmsenv replaced with eval command
Jan 23, 2014
66cb110
NB
Jan 23, 2014
af72d6a
testing RelVal 700
Jan 24, 2014
4578f5d
adding electron regression weights from package
Jan 24, 2014
f7006e8
fixing paths for Josh's regression weights and isoDepositsName
Jan 24, 2014
79cb3eb
added ECALELFINIT variable to shell to check the initialization
Jan 24, 2014
b8f9cc2
Merge branch 'master' of github.com:ECALELFS/ECALELF
Jan 24, 2014
38d1aa7
resubmitting if crab report missing and job exited with code 2
Jan 24, 2014
db6d0e3
fixed isCrab in python
Jan 24, 2014
4820e2c
fix
Jan 24, 2014
5995339
fixes
Jan 24, 2014
7d2b737
22Jan private rereco ntuples
Jan 24, 2014
a3b974d
updating instructions for ZFitter validation
Jan 24, 2014
21a3522
fixed the init of energyBranchName in ElectronCategory_class
Jan 24, 2014
08c9484
fixed the init of energyBranchName in ElectronCategory_class
Jan 24, 2014
4486609
use server removed from ntuple_production
Jan 26, 2014
5be7561
add load of pdf systematics varibles in crab jobs
Jan 26, 2014
1b92611
pdfSystWeight in ZFitter and scripts
Jan 26, 2014
cff330c
temporary solution for ntuple production
Jan 26, 2014
b767204
temporary comment of additional files
Jan 26, 2014
7fc7473
merged with master
Jan 26, 2014
4dbd8ae
Update README.md
Jan 27, 2014
a35b365
resubmit on 50800 error and remove unuseful stdout
Jan 27, 2014
5452468
no additional ntupleExtra file
Jan 27, 2014
67a6756
update of documentation
Jan 28, 2014
23eb65c
few information about fit outputs
Jan 28, 2014
eb34c1c
Update README.md
Jan 29, 2014
fc1b774
Update README.md
Jan 29, 2014
7e5e8c8
script to update documentation
Jan 29, 2014
d20c985
Merge branch 'master' of github.com:ECALELFS/ECALELF
Jan 29, 2014
368e71e
fixed wrong path for absEta stability plots
Jan 30, 2014
b5d227d
pdfWeights produced if pdfSys flag activated
Jan 30, 2014
48dec5b
pdfWeights taken in smearing
Jan 30, 2014
06a8998
new files with pdfSystematics
Jan 30, 2014
2b81187
better documentation
Jan 30, 2014
d259d30
reordering functions and documented class
Jan 30, 2014
ff0f91b
updated documentation
Jan 30, 2014
048b14a
updated documentation
Feb 1, 2014
53469fc
updated documentation
Feb 3, 2014
1a3f3b6
added further doc
Feb 3, 2014
319a0ab
gain switch info as unsigned char
Feb 6, 2014
90a18ec
smearing branch and invMassSigma branch production fixed
Feb 6, 2014
fbd86db
updated gitignore
Feb 6, 2014
399bf15
updated gitignore
Feb 6, 2014
988cd12
Merge branch 'gainSwitchFix'
Feb 6, 2014
d651698
up
Feb 7, 2014
b80e5ff
Merge branch 'pdfSystematics'
Feb 7, 2014
3c5c098
fixed Global Tags for CMSSW53 with run dep MC
Feb 7, 2014
1250e84
fixed warning
Feb 7, 2014
a5173f3
seed SC for trackerDriven electrons fix
Feb 7, 2014
3a277b2
update branch name
Feb 7, 2014
feb92a0
update
Feb 7, 2014
79787a5
Merge branch 'master' of github.com:ECALELFS/ECALELF
Feb 7, 2014
a8c6733
#9: fixed case of SC in EB and most energetic crystal in EE or viceversa
Feb 7, 2014
6187474
testing
obertino Feb 7, 2014
d9568d9
Merge branch 'master' of https://github.com/ECALELFS/ECALELF
obertino Feb 7, 2014
989633b
fixed DeltaPhi in electron matching
Feb 7, 2014
5fbb847
Merge branch 'master' of https://github.com/ECALELFS/ECALELF
obertino Feb 7, 2014
a062465
fixed #10 for ValueMapTranslator
obertino Feb 7, 2014
2b06f38
rereco Margherita IC1x1 Fabrice
obertino Feb 7, 2014
dcf402e
Revert "testing"
Feb 8, 2014
a7476b2
added rereco from Margherita
Feb 8, 2014
62c32cd
updated documentation
Feb 8, 2014
23f2634
updated documentation
Feb 8, 2014
6c729e7
updated documentation
Feb 8, 2014
db15dd5
updated 22Jan + MC run dependent ntuples with gainSwitch and pdfWeights
Feb 9, 2014
0719407
Additional check on number of files to be merged
Feb 11, 2014
2b14a65
SingleElectron alcareco with 22Jan rereco
Feb 11, 2014
aec98a2
speed up resubmit script
Feb 11, 2014
65f4505
flag for ntuple production with alcareco
Feb 11, 2014
e95a6b1
fixed nll init for first evaluation
Feb 11, 2014
8585efe
improved output
Feb 11, 2014
9ecbd3e
fixed bug in gainEle cut
Feb 11, 2014
7386de9
removed debug option
Feb 11, 2014
841e1c7
fixed column for rereco list
Feb 11, 2014
1a6b935
Merge branch 'resubmitScript'
Feb 11, 2014
6c05a3f
more ntuple branches commented, few informations about pileup tree pr…
Feb 23, 2014
b8dce5f
updated documentation
Feb 23, 2014
bb38c90
added awk script for merging energy scale corrections from different …
Feb 25, 2014
0345ea7
fixed keep command for ALCARECO for isoVals
Feb 25, 2014
26fc1a2
small fixes
Feb 25, 2014
d4d5d3d
fixes and revisited energyScale
Feb 25, 2014
f9fbb64
updated stability scripts
Feb 25, 2014
2ab0053
improved dealing with smear and scale additional branches
Feb 25, 2014
187df09
added ratio plot to data/mc and improved likelihood profile fit
Feb 25, 2014
2dbed33
added not Et category
Feb 25, 2014
9aa06d8
additional smearing from friend tree with also smearingSigma branch
Feb 25, 2014
dbea56e
onlyScale option added
Feb 25, 2014
9adfe76
more checks on pdfWeights
Feb 25, 2014
5eb99de
merging
Feb 25, 2014
ed7f45f
updated documentation
Feb 26, 2014
f61d387
new page with requirements
Mar 4, 2014
b485654
updated documentation
Feb 27, 2014
294aa21
reverted
Mar 4, 2014
fe64d36
updating documentation
Mar 4, 2014
325925c
updated energy class for CB smearing
Mar 7, 2014
1495fcd
new bkg and particle gun samples
Mar 8, 2014
c0441e4
fixes and Wenu skim ntuple production
Mar 8, 2014
34c3dd2
include prodFunctions in fileListDatasets and improve job check and r…
Mar 8, 2014
61bd11d
added ZPtWeight class and include CB smearing in ZFitter
Mar 8, 2014
6383e7c
removed unused regions
Mar 8, 2014
d1c0783
updated ntuples with gainSwitch information
Mar 8, 2014
97fec0f
ZPt used in smearing method
Mar 8, 2014
78b6551
added to the list of documented classes
Mar 8, 2014
fcec0eb
improved macros for plot and likelihood profile scan
Mar 8, 2014
991509d
fixing energy scale derivation procedure and additional checks
Mar 8, 2014
35627d5
fixing energy scale derivation procedure and additional checks
Mar 8, 2014
919e3eb
fixing CB smearing
Mar 8, 2014
0c3f5ab
SingleEle option for Et categorization
Mar 8, 2014
6258c8a
removed directories from documentation
Mar 8, 2014
091f2aa
merged with improved documentation
Mar 8, 2014
04ac3f5
new config files
Mar 8, 2014
9d2f485
documenting energy scale derivation
Mar 8, 2014
6935123
additional regions for systematic studies
Mar 9, 2014
78b2851
added fsr and weak interferance for Z lineshape systematic studies
Mar 9, 2014
50f0e28
fixed smearEle in toyMC study with smearing method
Mar 9, 2014
890fba1
fix seed ix iy for EE electrons
Mar 11, 2014
270f5cb
using weak and fsr weights in smearing method
Mar 11, 2014
d228652
fixed bug in fsr and weak weight for data sample
Mar 11, 2014
18522c8
fix to be sure no pdfSystematics is produced for data
Mar 11, 2014
d6ca6fd
fix to be sure no pdfSystematics is produced for data
Mar 11, 2014
1b8a803
fix to be sure no pdfSystematics is produced for data
Mar 11, 2014
54fa88a
added particleGun option in ntuplizer and alcaSkimming
Mar 12, 2014
adec8de
added option (redundant) in prodNtuples
Mar 12, 2014
5296729
updated documentation
Mar 26, 2014
2f796a5
updated ntuples
Mar 31, 2014
27e92c0
Merge branch 'master' of github.com:ECALELFS/ECALELF
Mar 31, 2014
d2991df
small guide for developers
Apr 3, 2014
7054b58
updating instructions
Apr 16, 2014
e8cda9d
test version for including highEta
hengne Apr 16, 2014
bd98e35
cleaned ZNtupleDumper for highEta
May 25, 2014
2839b45
changes in alcaSkimming.py
May 26, 2014
d4814fb
isWenu and HighEta taken from HLTResults
May 26, 2014
8ed4d1b
revisioned class, cleaned code, added saving of EE recHits at highEta…
May 26, 2014
841ca43
ZNtupleDumper code cleaning
May 26, 2014
fd2e250
cleaned skims
May 30, 2014
4f4f636
removed highEta options
May 30, 2014
46ca6df
mmm
May 30, 2014
de3fc36
added new alcareco with fixed paths
Jun 3, 2014
06339f4
regression root files on EOS for remoteGlidein
Jun 3, 2014
eafe527
fixed extraCalib ntuples production
Jun 3, 2014
a256606
WZFilter added to skims
Jun 5, 2014
e14f142
cleaned alcaSkimming python and fixed ntuplePath for alcareco+ntuple …
Jun 5, 2014
e2f15fd
gedGsfElectrons kept in alcareco
Feb 8, 2014
ac3c87b
explicit gsfElectron collection for MC matching
Feb 8, 2014
9dd094f
old crashing regression removed and fixed setup accordingly
Feb 8, 2014
d737b4b
changed gsfElectrons to gedgsfElectrons throughout
Mar 5, 2014
9d2d2a7
electron collection name defined by variable at beginning of alcaSkim…
Jun 6, 2014
7fa2d31
added ifdef for CMSSW70X
Jun 6, 2014
af52dbf
ele regression patch
Jun 6, 2014
df77a25
flag for CMSSW_7_0_X
Mar 20, 2014
3ed1326
safe check on hlt trigger results
Jun 6, 2014
2b0f4d1
testing sample for clustering CMSSW700pre13
Mar 31, 2014
5faac66
not global dbs instance
Mar 31, 2014
dbee413
specific fix for one dataset
Mar 31, 2014
80ae7af
electron collection name dependent on the CMSSW version
Jun 6, 2014
61322b8
cleaned and fixed setup git
Jun 6, 2014
9b82b06
fixed indentation in alcaSkimming
Jun 6, 2014
a8b90ca
adding documentation for local tests
Jun 6, 2014
b129d52
ZSkim WSkim ZSCSkim for ntuple production
Jun 6, 2014
71e6518
slc5 resources for caf
Jun 9, 2014
e62afd3
updated paths and scripts
Jun 12, 2014
bc91ad1
added CMSSW_7_0_X rereco of 2012 data
Jun 12, 2014
bf8f2de
fix #20 in devel branch (will be merged with master)
Jun 13, 2014
71267ee
added 15Apr rereco of 2012 data in CMSSW_70X
Jun 13, 2014
6984f79
ZHLT skim added
Jun 13, 2014
40b3ac2
fixed ZNtupleDumper
Jun 13, 2014
4cdddf5
fixing documentation
Jun 20, 2014
dd81bb7
fixup! fixing documentation
Jun 20, 2014
7cdd0cd
fixup! fixing documentation
Jun 20, 2014
f280450
fixup! fixing documentation
Jun 20, 2014
fb393bd
update documentation
Jun 23, 2014
0a0d105
Merge remote branch 'origin/fixingDocumentation'
Jun 23, 2014
d0258bc
adding graph schema of ecalelf
Jun 23, 2014
d72f603
updated doxygen config
Jun 23, 2014
4f55559
updating documentation
Jun 23, 2014
26a7aac
removed pdfTreeSyst bool from the input parameters
Jul 1, 2014
c04dfa1
set INVALID and VALID also for alcareco_datasets.dat
Jul 4, 2014
5d6d5ce
ntuple and alcareco production in the same job
Jul 4, 2014
69907bf
Fixing unixTime in ntuples as unsigned int
Jul 4, 2014
93d1152
setup_git fixed for hengne
Jul 4, 2014
f9a02e8
rereco to test IC and eta scale
Jul 14, 2014
672ccc3
updating documentation
Jul 30, 2014
493865e
fixes and Test_ICEtaHengne rereco done
Jul 30, 2014
6d91a23
ZSkimPath ntuples for MC
Aug 1, 2014
6215320
removed invalid single electron alcareco
Aug 25, 2014
eb817d4
added paths for studying skim efficiency
Aug 25, 2014
7a8ef4b
ALCARECOSIM for geometry study
Aug 25, 2014
49be195
missing gsf electron name change
Aug 26, 2014
0ea7fb2
missing modification for .cc file
Aug 26, 2014
9465026
Updated documentation for rereco and ntuple production
Aug 1, 2014
8e2b3d5
removed spaces and comments
Aug 1, 2014
f345b1f
removed old readme
Aug 26, 2014
35dfcac
missing gsf electron name change
Aug 26, 2014
877685d
fixed missing modules for ele isolation variables in alcaraw
Aug 26, 2014
5d47a9a
Updated documentation
Sep 8, 2014
76bc317
fixed inputTag
Sep 8, 2014
ed6ed3a
updated documentation
Sep 8, 2014
53fb2b6
updated documentation
Sep 8, 2014
8140e9e
fixed alcaraw
Sep 9, 2014
6d5efec
fixed isCrab option
lbrianza Sep 21, 2014
f0738cb
Some changes to adapt to the EOverP code
lbrianza Sep 21, 2014
f580995
E/P calibration area
lbrianza Sep 21, 2014
ba9c8e8
update
lbrianza Sep 21, 2014
6b0e89f
E/P calibration area
lbrianza Sep 21, 2014
aa09d1a
E/P calibration area
lbrianza Sep 21, 2014
c6078f6
E/p calibration integrated in ZFitter.cpp
lbrianza Sep 26, 2014
30e056a
E/p calibration integrated in ZFitter.cpp
lbrianza Sep 26, 2014
7b0fb85
E/p calibration integrated in ZFitter.cpp
lbrianza Sep 26, 2014
39d8f1a
changed default value for nLoops
lbrianza Sep 26, 2014
26983fd
isW, isZ, isEBEle: removed
lbrianza Sep 28, 2014
3f032a2
isW, isZ, isEBEle: removed
lbrianza Sep 28, 2014
620fd12
E/p library included in the makefile
lbrianza Sep 28, 2014
c3a9b41
setup fixed for luca
lbrianza Oct 10, 2014
49acf89
Merge remote-tracking branch 'upstream/master'
mrappo Dec 19, 2016
2156d50
fix bugs when running E/p on master branch
mrappo Dec 19, 2016
9fdbd7a
fix bugs when running E/p on master branch
mrappo Dec 19, 2016
847599c
update branch names
mrappo Jan 16, 2017
43e4544
update laser monitoring to run with new ntuples
mrappo Jan 17, 2017
96bee05
update laser monitoring to run with new ntuples
mrappo Jan 17, 2017
b83437e
remove saving of root file in laserMonitoring class and update monito…
mrappo Jan 20, 2017
315040b
update calibration scripts
mrappo Jan 20, 2017
f6f46ea
update calibration script
mrappo Jan 20, 2017
69cfba7
fix bug in the names saved in the scripts
mrappo Jan 24, 2017
9f6c43d
fix bug in the names saved in the scripts
mrappo Jan 24, 2017
c0f4e25
update scripts
mrappo Feb 20, 2017
f9c6878
coherent names of folders between script and code
mrappo Feb 20, 2017
58c8fd4
separate momentum corrections for electrons and positrons
mrappo Mar 9, 2017
59145fb
fix bug in TEndcapRings
mrappo Mar 20, 2017
05fbf85
fix type of chargeEle
mrappo Mar 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 69 additions & 65 deletions EOverPCalibration/bin/CalibrationMomentum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ int main(int argc, char** argv)
if(Options.existsAs<bool>("usePUweights"))
usePUweights = Options.getParameter<bool>("usePUweights");

int chargeValue = -1;
if(Options.existsAs<int>("chargeValue"))
chargeValue = Options.getParameter<int>("chargeValue");

cout << " Basic Configuration " << endl;
cout << " Tree Name = " << TreeName << endl;
cout << " infileDATA = " << infileDATA << endl;
Expand All @@ -145,6 +149,7 @@ int main(int argc, char** argv)
cout << " rebinEB = " << rebinEB << endl;
cout << " rebinEE = " << rebinEE << endl;
cout << " usePUweights = " << usePUweights << endl;
cout << " chargeValue = " << chargeValue << endl;

cout << "Making calibration plots for Momentum scale studies " << endl;

Expand All @@ -155,15 +160,15 @@ int main(int argc, char** argv)
float eta2Max = 2.5;

//--- weights for MC
TFile weightsFile (WeightforMC.c_str(), "READ");
TH1F* hweights = (TH1F*)weightsFile.Get("pileup");
// TFile weightsFile (WeightforMC.c_str(), "READ");
// TH1F* hweights = (TH1F*)weightsFile.Get("pileup");

float w[100];
/* float w[100];
for (int ibin = 1; ibin < hweights->GetNbinsX() + 1; ibin++) {
w[ibin - 1] = hweights->GetBinContent(ibin); // bin 1 --> nvtx = 0
}
weightsFile.Close();

*/
//histos to get the bin in phi given the electron phi
TH1F* hPhiBinEB = new TH1F("hphiEB", "hphiEB", nPhiBinsEB, -1.*TMath::Pi(), 1.*TMath::Pi());
TH1F* hPhiBinEE = new TH1F("hphiEE", "hphiEE", nPhiBinsEE, -1.*TMath::Pi(), 1.*TMath::Pi());
Expand All @@ -180,15 +185,14 @@ int main(int argc, char** argv)

// observables
// int isW;
float invMass_SC;
float invMass_ECAL_ele;
float etaSCEle[3], phiSCEle[3];
float etaEle[3], phiEle[3];
float energySCEle[3], rawEnergySCEle[3], R9Ele[3];
int chargeEle[3];
Short_t chargeEle[3];
float pAtVtxGsfEle[3];
float seedXSCEle[3], seedYSCEle[3];
float xSeedSC[3], ySeedSC[3];
int NPU[1];
float PtEle[3];
int ele1_iz, ele2_iz;

// Set branch addresses for Data
Expand All @@ -202,22 +206,20 @@ int main(int argc, char** argv)
ntu_DA->SetBranchAddress("etaSCEle", &etaSCEle);
ntu_DA->SetBranchStatus("phiSCEle", 1);
ntu_DA->SetBranchAddress("phiSCEle", &phiSCEle);
ntu_DA->SetBranchStatus("energySCEle", 1);
ntu_DA->SetBranchAddress("energySCEle", &energySCEle);
ntu_DA->SetBranchStatus("energy_ECAL_ele", 1);
ntu_DA->SetBranchAddress("energy_ECAL_ele", &energySCEle);
ntu_DA->SetBranchStatus("rawEnergySCEle", 1);
ntu_DA->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle);
ntu_DA->SetBranchStatus("PtEle", 1);
ntu_DA->SetBranchAddress("PtEle", &PtEle);
ntu_DA->SetBranchStatus("invMass_SC", 1);
ntu_DA->SetBranchAddress("invMass_SC", &invMass_SC);
ntu_DA->SetBranchStatus("invMass_ECAL_ele", 1);
ntu_DA->SetBranchAddress("invMass_ECAL_ele", &invMass_ECAL_ele);
ntu_DA->SetBranchStatus("chargeEle", 1);
ntu_DA->SetBranchAddress("chargeEle", &chargeEle);
ntu_DA->SetBranchStatus("pAtVtxGsfEle", 1);
ntu_DA->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle);
ntu_DA->SetBranchStatus("seedXSCEle", 1);
ntu_DA->SetBranchAddress("seedXSCEle", &seedXSCEle);
ntu_DA->SetBranchStatus("seedYSCEle", 1);
ntu_DA->SetBranchAddress("seedYSCEle", &seedYSCEle);
ntu_DA->SetBranchStatus("xSeedSC", 1);
ntu_DA->SetBranchAddress("xSeedSC", &xSeedSC);
ntu_DA->SetBranchStatus("ySeedSC", 1);
ntu_DA->SetBranchAddress("ySeedSC", &ySeedSC);


// Set branch addresses for MC
Expand All @@ -231,22 +233,20 @@ int main(int argc, char** argv)
ntu_MC->SetBranchAddress("etaSCEle", &etaSCEle);
ntu_MC->SetBranchStatus("phiSCEle", 1);
ntu_MC->SetBranchAddress("phiSCEle", &phiSCEle);
ntu_MC->SetBranchStatus("energySCEle", 1);
ntu_MC->SetBranchAddress("energySCEle", &energySCEle);
ntu_MC->SetBranchStatus("energy_ECAL_ele", 1);
ntu_MC->SetBranchAddress("energy_ECAL_ele", &energySCEle);
ntu_MC->SetBranchStatus("rawEnergySCEle", 1);
ntu_MC->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle);
ntu_MC->SetBranchStatus("PtEle", 1);
ntu_MC->SetBranchAddress("PtEle", &PtEle);
ntu_MC->SetBranchStatus("invMass_SC", 1);
ntu_MC->SetBranchAddress("invMass_SC", &invMass_SC);
ntu_MC->SetBranchStatus("invMass_ECAL_ele", 1);
ntu_MC->SetBranchAddress("invMass_ECAL_ele", &invMass_ECAL_ele);
ntu_MC->SetBranchStatus("chargeEle", 1);
ntu_MC->SetBranchAddress("chargeEle", &chargeEle);
ntu_MC->SetBranchStatus("pAtVtxGsfEle", 1);
ntu_MC->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle);
ntu_MC->SetBranchStatus("seedXSCEle", 1);
ntu_MC->SetBranchAddress("seedXSCEle", &seedXSCEle);
ntu_MC->SetBranchStatus("seedYSCEle", 1);
ntu_MC->SetBranchAddress("seedYSCEle", &seedYSCEle);
ntu_MC->SetBranchStatus("xSeedSC", 1);
ntu_MC->SetBranchAddress("xSeedSC", &xSeedSC);
ntu_MC->SetBranchStatus("ySeedSC", 1);
ntu_MC->SetBranchAddress("ySeedSC", &ySeedSC);

if(usePUweights) {
ntu_MC->SetBranchStatus("NPU", 1);
Expand Down Expand Up @@ -440,8 +440,8 @@ int main(int argc, char** argv)
// if( isW == 1 ) continue;
if( fabs(etaSCEle[0]) > etaMax ) continue;
if( fabs(etaSCEle[1]) > eta2Max ) continue;
if( PtEle[0] < 20. ) continue;
if( PtEle[1] < 20. ) continue;
if( (energySCEle[0]/cosh(etaEle[0])) < 20. ) continue;
if( (energySCEle[1]/cosh(etaEle[1])) < 20. ) continue;

if ( fabs(etaEle[0]) < 1.479) ele1_iz = 0;
else if (etaEle[0] > 0) ele1_iz = 1;
Expand All @@ -453,19 +453,20 @@ int main(int argc, char** argv)

//--- PU weights
float ww = 1.;
if( usePUweights ) ww *= w[NPU[0]];
// if( usePUweights ) ww *= w[NPU[0]];

if( (chargeEle[1]<0 && chargeValue<0) || (chargeEle[1]>0 && chargeValue>0)) {
//--- set the mass for ele1
// var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
// var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
// simulate e+/e- asymmetry
//if( chargeEle[0] > 0 ) ww *= 1.*(6/5);
//else ww *= 1.*(4/5);

// MC - BARREL - ele1
if( ele1_iz == 0 ) {
// fill MC templates
int modPhi = int(seedYSCEle[0] / (360. / nPhiBinsTempEB));
int modPhi = int(ySeedSC[0] / (360. / nPhiBinsTempEB));
if( modPhi == nPhiBinsTempEB ) modPhi = 0;

int regionId = templIndexEB(typeEB, etaEle[0], chargeEle[0], R9Ele[0]);
Expand All @@ -484,10 +485,10 @@ int main(int argc, char** argv)

// MC - ENDCAP - ele1
else {
int iphi = eRings->GetEndcapIphi(seedXSCEle[0], seedYSCEle[0], ele1_iz);
int iphi = eRings->GetEndcapIphi(xSeedSC[0], ySeedSC[0], ele1_iz);

if( ele1_iz == 1 )mapConversionEEp -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]);
if( ele1_iz == -1 )mapConversionEEm -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]);
if( ele1_iz == 1 )mapConversionEEp -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]);
if( ele1_iz == -1 )mapConversionEEm -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]);


// fill MC templates
Expand All @@ -507,20 +508,21 @@ int main(int argc, char** argv)
(h_EoP_EE.at(PhibinEE)).at(regionId) -> Fill(var * var, ww); // This is MC
h_phi_mc_EE[regionId] -> Fill(phiSCEle[0], ww);
}
}



else{
//--- set the mass for ele2
// var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
// var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
// simulate e+/e- asymmetry
//if( chargeEle[0] > 0 ) ww *= 1.*(6/5);
//else ww *= 1.*(4/5);

// MC - BARREL - ele2
if( ele2_iz == 0) {
// fill MC templates
int modPhi = int (seedYSCEle[1] / (360. / nPhiBinsTempEB));
int modPhi = int (ySeedSC[1] / (360. / nPhiBinsTempEB));
if( modPhi == nPhiBinsTempEB ) modPhi = 0;

int regionId = templIndexEB(typeEB, etaEle[1], chargeEle[1], R9Ele[1]);
Expand All @@ -539,10 +541,10 @@ int main(int argc, char** argv)

// MC - ENDCAP - ele2
else {
if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]);
if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]);
if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]);
if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]);

int iphi = eRings->GetEndcapIphi(seedXSCEle[1], seedYSCEle[1], ele2_iz);
int iphi = eRings->GetEndcapIphi(xSeedSC[1], ySeedSC[1], ele2_iz);


// fill MC templates
Expand All @@ -562,9 +564,10 @@ int main(int argc, char** argv)
(h_EoP_EE.at(PhibinEE)).at(regionId) -> Fill(var * var, ww); // This is MC
h_phi_mc_EE[regionId]->Fill(phiSCEle[1], ww);
}
}

h_et_mc ->Fill(PtEle[0], ww);
h_et_mc ->Fill(PtEle[1], ww);
h_et_mc ->Fill((energySCEle[0]/cosh(etaEle[0])), ww);
h_et_mc ->Fill((energySCEle[1]/cosh(etaEle[1])), ww);
}


Expand All @@ -584,8 +587,8 @@ int main(int argc, char** argv)
// if( isW == 1 ) continue;
if( fabs(etaSCEle[0]) > etaMax ) continue;
if( fabs(etaSCEle[1]) > eta2Max ) continue;
if( PtEle[0] < 20. ) continue;
if( PtEle[1] < 20. ) continue;
if( (energySCEle[0]/cosh(etaEle[0])) < 20. ) continue;
if( (energySCEle[1]/cosh(etaEle[1])) < 20. ) continue;

float ww = 1.;

Expand All @@ -597,12 +600,12 @@ int main(int argc, char** argv)
else if (etaEle[1] > 0) ele2_iz = 1;
else ele2_iz = -1;


if( (chargeEle[1]<0 && chargeValue<0) || (chargeEle[1]>0 && chargeValue>0)) {
//--- set the mass for ele1
// if( ele1_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
// else var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
if( ele1_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
else var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
// if( ele1_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
// else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19;
if( ele1_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19;
// simulate e+/e- asymmetry
//if( chargeEle[0] > 0 ) ww *= 1.*(6/5);
//else ww *= 1.*(4/5);
Expand All @@ -622,8 +625,8 @@ int main(int argc, char** argv)

// DATA - ENDCAP - ele1
else {
if( ele1_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]);
if( ele1_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]);
if( ele1_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]);
if( ele1_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]);

int PhibinEE = hPhiBinEE->FindBin(phiEle[0]) - 1;
if( PhibinEE == nPhiBinsEE ) PhibinEE = 0;
Expand All @@ -635,14 +638,14 @@ int main(int argc, char** argv)
(h_Phi_EE.at(PhibinEE)).at(regionId) -> Fill(phiEle[0]);
h_phi_data_EE[regionId] -> Fill(phiEle[0]);
}
}



else{
//--- set the mass for ele2
// if( ele2_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
// else var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
if( ele2_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
else var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
// if( ele2_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
// else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19;
if( ele2_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19;
// simulate e+/e- asymmetry
//if( chargeEle[0]Ele[1] > 0 ) ww *= 1.*(6/5);
//else ww *= 1.*(4/5);
Expand All @@ -659,8 +662,8 @@ int main(int argc, char** argv)
(h_Phi_EB.at(PhibinEB)).at(regionId) -> Fill(phiEle[1]);
h_phi_data_EB[regionId] -> Fill(phiEle[1]);
} else {
if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]);
if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]);
if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]);
if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]);

int PhibinEE = hPhiBinEE->FindBin(phiEle[1]) - 1;
if( PhibinEE == nPhiBinsEE ) PhibinEE = 0;
Expand All @@ -672,9 +675,10 @@ int main(int argc, char** argv)
(h_Phi_EE.at(PhibinEE)).at(regionId) -> Fill(phiEle[1]);
h_phi_data_EE[regionId] ->Fill(phiEle[1]);
}
}

h_et_data ->Fill(PtEle[0]);
h_et_data ->Fill(PtEle[1]);
h_et_data ->Fill((energySCEle[0]/cosh(etaEle[0])));
h_et_data ->Fill((energySCEle[1]/cosh(etaEle[1])));
}

std::cout << "End loop: Analyze events " << endl;
Expand Down
5 changes: 3 additions & 2 deletions EOverPCalibration/cfg/calibrationMomentum_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
nPhiBinsTempEE = cms.int32(1),
rebinEB = cms.int32(10),
rebinEE = cms.int32(20),
outputFile = cms.string("output/MomentumCalibration2016.root"),
outputFile = cms.string("output/MomentumCalibration2016"),
typeEB = cms.string("eta1"),
typeEE = cms.string("eta1")
typeEE = cms.string("eta1"),
chargeValue = cms.int32(-1)

)

24 changes: 8 additions & 16 deletions EOverPCalibration/cfg/listDATA_momentumCalibration.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
##MULTIFIT

#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-279588.root
#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016G-ZSkim-Prompt-v1-279589-279931.root

##WEIGHTS
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco/273150-275376/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco-273150-275376.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco/275420-276283/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco-275420-276283.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco/276315-276811/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco-276315-276811.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco/276830-277420/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco-276830-277420.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco/277820-278808/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco-277820-278808.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/278817-279588/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-278817-279588.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/279589-279931/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-279589-279931.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-280385/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-280385.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v2/281207-284035/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016H-ZSkim-Prompt-v2-281207-284035.root
eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v3/284036-284068/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016H-ZSkim-Prompt-v3-284036-284068.root
Loading