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

Porting to CMSSW 12_3_X #37

Open
wants to merge 294 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
d26dd83
small fixes for when L1 bits are to be stored in ntuples in FillEpsil…
cippy May 26, 2017
68d0f4f
fix: adding a final slash to /tmp that was preventing files on eos fr…
cippy May 27, 2017
a12e72c
small fix
cippy Jun 5, 2017
2b58c21
use eos cp to copy files
cippy Jun 5, 2017
0de84a2
Porting of ECALpro to 91X and other improvements (#32)
cippy Jun 6, 2017
69d31cc
fix bug rejecting all events in EE and adding a histogram to keep tra…
cippy Jun 11, 2017
ee90d78
if MakeNtuple4optimization is True, print warning message and quit be…
cippy Jun 11, 2017
1954eca
removing MC branches from Tree_Optim if running on data
cippy Jun 12, 2017
e068ec9
runs used to produce m(pi0) for approval at ECAL DPG
cippy Jun 16, 2017
34dafe4
preparing to run on 2017 data and do IC
cippy Jun 16, 2017
9aab5d3
fixed part to test whether a file is present on eos
cippy Jul 13, 2017
f03d059
adding prefix string before file to allow reading of files not on eos…
cippy Jul 13, 2017
2416dfd
fixed scripts that deal with copying and removing files in /tmp/
cippy Jul 13, 2017
e8fc603
fixes, adding recovery for EcalNtp fiel only when producing optimizat…
cippy Jul 21, 2017
5d4391a
use eos from batch, adapt prefix for root files on eos and other fixes
cippy Jul 21, 2017
f1fdeed
add the smearer of the calib map
emanueledimarco Aug 2, 2017
8a58ccd
some updates for 92X
emanueledimarco Aug 2, 2017
02f8a39
Merge branch '92X_mciprian' of git://github.com/cippy/ECALpro into ci…
emanueledimarco Aug 2, 2017
5e00438
Merge branch 'cippy-92X_mciprian' into cmsdas2017
emanueledimarco Aug 2, 2017
72b495b
changes for make CMS DAS tests running
emanueledimarco Aug 2, 2017
bd34ecc
changes to use the fact that EOS is mounted as a normal filesystem on…
emanueledimarco Aug 3, 2017
a0376c9
bug fixes (crashes and scripts)
emanueledimarco Aug 3, 2017
a25ba66
test 2017 file list for DAS school
emanueledimarco Aug 3, 2017
18a4e63
anohter round of debugging the submission scripts
emanueledimarco Aug 4, 2017
a5885c2
improvements and additions for DAS 2017
emanueledimarco Aug 4, 2017
d7787c1
update before switching branches
cippy Aug 4, 2017
fccb068
commit before changes
cippy Aug 4, 2017
0e90c5f
Merge remote-tracking branch 'emanueledimarco/cmsdas2017' into 92X_mc…
cippy Aug 4, 2017
b3fe4e5
yet another fix at the end of the chain
emanueledimarco Aug 4, 2017
857ca09
another fix
emanueledimarco Aug 4, 2017
039466f
adding option to skip extension automatically
cippy Aug 14, 2017
0fc3087
fixes
cippy Aug 14, 2017
ee1f34d
fixes, avoid double slashes in paths on eos, using non generic name f…
cippy Aug 14, 2017
c68805d
add option isDebug to trigger some cout for debug in FillepsilonPlot.cc
cippy Aug 14, 2017
66d363b
add option isDebug to trigger some cout for debug in FillepsilonPlot.cc
cippy Aug 14, 2017
d74b29c
use non generic name for file with fits created in /tmp
cippy Aug 14, 2017
d781573
adding isDebug flag
cippy Aug 14, 2017
34a2f08
fixes
cippy Aug 14, 2017
c11cd9f
fixes, add option to select pi0 or eta
cippy Aug 14, 2017
605cf98
fixes
cippy Aug 14, 2017
c7a78df
script to merge *fitRes.root files, it is useful if one looks for a s…
cippy Aug 14, 2017
1f73192
Merge remote-tracking branch 'emanueledimarco/cmsdas2017' into 92X_mc…
cippy Aug 14, 2017
66735fc
add BX information in ntuples
cippy Sep 21, 2017
5ad74b1
golden json 2017 up to run 302654
cippy Sep 21, 2017
02e7238
fix bunch crossing getter
cippy Sep 23, 2017
acb32f8
use different axis range for mass when using first iteration
cippy Sep 23, 2017
3d6f1e2
adding L1 trigger composition histo for EE and EB separately; recreat…
cippy Sep 25, 2017
32cd4ae
use different mass range for first iteration and other small fixes
cippy Sep 25, 2017
87a7a75
L1 trigger composition histograms for EB and EE separately
cippy Sep 27, 2017
52c27b7
trying to fix the fit part, add iteratively more terms in polynomial …
cippy Sep 27, 2017
eeb7241
using int type for variables that are integers
cippy Oct 5, 2017
96f538c
if working with first iteration (iter_0), do not try to look for prev…
cippy Oct 5, 2017
2b15770
using int type for variables that are integers
cippy Oct 5, 2017
8e93b80
add option to choose to run on even or odd events (works only when su…
cippy Oct 5, 2017
1ebabb1
add option to draw relative map normalized to 1 in each eta-ring
cippy Oct 12, 2017
2c3f072
for very first iteration use different ranges (unless it is an extens…
cippy Oct 12, 2017
1aefa6a
save more fit parameters, save TCanvas as well as RooPlot, remove Chi…
cippy Oct 12, 2017
e5a26f0
get back to RooMinuit fit to fix other things (but this is obsolete a…
cippy Oct 13, 2017
0e6f729
Merge pull request #1 from cippy/92X_mciprian
Oct 13, 2017
1cdce7f
adding containment correction with 2017 regression
Oct 15, 2017
4d28e7e
backup
cippy Nov 7, 2017
d33dc38
fill with -1 unused crystals positions to distinguish from ietaring = 0
cippy Nov 19, 2017
7ae182d
introducing plots normalized to 1 in ietarings
cippy Nov 19, 2017
80e9d87
improving fit using RooMinimizer instead of obsolete RooMinuit
cippy Nov 19, 2017
36339e0
file updated: -1 in not existing crystals
cippy Nov 19, 2017
c880f2b
removed awk matching based on RooMinuit, now using RooMinimizer
cippy Nov 19, 2017
c540572
adding chi2 plots
cippy Nov 19, 2017
1153c6c
merging from Zhicai
cippy Nov 20, 2017
7702ead
utility script to manage production of txt and root file with IC and …
cippy Nov 22, 2017
1ec6936
plot gaussian signal as well in fits
cippy Nov 27, 2017
e28d2f2
add possibility to plot a single plot with given index and other fixes
cippy Nov 27, 2017
d14b191
style fixes for chi^2
cippy Nov 27, 2017
4bcb502
backup before merge
cippy Dec 4, 2017
6909aea
Merge remote-tracking branch 'ecalelf-central/master' into 92X_mcipri…
cippy Dec 4, 2017
fb4f5d8
macros to get fit index given cartesian coordinates in EB and EE, and…
cippy Dec 4, 2017
c444b1e
small fixes: using string instead of char*, correcting variable names…
cippy Dec 18, 2017
1d5a960
updates to work with MC
cippy Dec 27, 2017
3014927
adding lists of 2017 data already purified with json Cert_294927-3064…
cippy Dec 27, 2017
5a813a7
golden json for 2017 (prompt)
cippy Dec 27, 2017
2492b09
golden json for 2017 (prompt)
cippy Dec 27, 2017
d9ede68
moving char to string
cippy Dec 27, 2017
a7feed3
add flag to activate E/Etrue (for MC only)
cippy Dec 27, 2017
a2e8eeb
add flag to activate E/Etrue (for MC only)
cippy Dec 27, 2017
1a49fcb
general updates
cippy Dec 28, 2017
40d06e6
Merge remote-tracking branch 'origin/94X_mciprian' into 94X_mciprian
cippy Dec 28, 2017
3dc932b
small fixes
cippy Dec 28, 2017
320428e
put MC stuff together
cippy Dec 28, 2017
a9caa52
updates
cippy Dec 29, 2017
7afcccd
updates for E/Etrue
cippy Jan 1, 2018
51f49cc
several updates for E/Etrue with MC
cippy Jan 3, 2018
8b16bc9
if an IC is exactly 1, do not divide it by the average (1 means eithe…
cippy Jan 3, 2018
3c97ddf
add comment with path to file to get etaRings is eta
cippy Jan 4, 2018
b584795
fix for the average
cippy Jan 5, 2018
fb0ebf3
fix in the print
cippy Jan 5, 2018
fdae7dc
more bins for TH1 in EE
cippy Jan 5, 2018
de28c89
fix eta-ring ranges in EE
cippy Jan 5, 2018
65badfe
using static variables to define the fit range for pi0
cippy Jan 7, 2018
494e380
order reco photons by seed energy when doing the matching
cippy Jan 9, 2018
c9ac230
use lower value for minimum integral to fit E/Etrue
cippy Jan 9, 2018
69b2b62
use less bins for single-crystal E/Etrue in MC, statistics expected t…
cippy Jan 9, 2018
bfa387a
small fixes in the writing on the main shell script to manage the cal…
cippy Jan 9, 2018
07e2c59
fixing things in the function to save coefficient for E/Etrue in MC
cippy Jan 9, 2018
ae84add
overwrite log file instead of appending new to old one (might resubmi…
cippy Jan 9, 2018
6dcbf0c
fixes to manage second photon in MC with E/Etrue
cippy Jan 9, 2018
fd96aa7
updates the final merging of calibration maps when using E/Etrue with MC
cippy Jan 10, 2018
6960177
fix in the palette and mass range in plot for first iteration
cippy Jan 10, 2018
4f53d1e
fix order of iphi and ieta
cippy Jan 10, 2018
c3d8434
adding option to choose fit tool (RooMinuit or RooMinimizer) and othe…
cippy Jan 12, 2018
b1a1abd
improve clustering algorithm: not count crystals of discarded cluster…
cippy Jan 12, 2018
702bde7
adding list of files for era B and C of 2017
cippy Jan 12, 2018
ed1601f
committing shell script: wrapper to use createICmaps.sh
cippy Jan 12, 2018
22da693
use TH1::SetDefaultSumw2() to automatically enable TH1::Sumw2() for e…
cippy Jan 12, 2018
b488274
add possibility to include common options and other fixes
cippy Jan 13, 2018
38a3756
improving fit tools for E/Etrue in MC
cippy Jan 14, 2018
0d08ec2
adding possibility to simply merge fits (allowing to refit a single p…
cippy Jan 14, 2018
c3e9136
allowing to just merge the fits
cippy Jan 14, 2018
8f2816c
allow to choose between left or double crystal ball for E/Etrue in MC
cippy Jan 15, 2018
598f31c
implementing folding of EB into a single SM in E/Etrue for MC
cippy Jan 15, 2018
cba99c6
fixes; implementing folding of EB into a single SM in E/Etrue for MC
cippy Jan 15, 2018
4f0e376
fix usage of DetId index
cippy Jan 15, 2018
e6737f1
fixes in index names
cippy Jan 16, 2018
85b6301
udates, now eos is mounted
cippy Jan 16, 2018
0343990
new simple macro to count histograms in a TFile
cippy Jan 16, 2018
1e4afe2
small fix
cippy Jan 16, 2018
e456465
fixes for E/Etrue
cippy Jan 16, 2018
98952c5
fix in using DetId
cippy Jan 16, 2018
36f4d35
modified after fixing the macro that created that
cippy Jan 16, 2018
9f3f147
macro to store eta given crystal cartesian coordinates in EE inside a…
cippy Jan 16, 2018
a22b88d
small fix
cippy Jan 16, 2018
6e7ec4d
commit to allow changing branch
cippy Jan 16, 2018
ebd2a72
Merge branch '94X_mciprian_EoEtrueDevel' into 94X_mciprian
cippy Jan 16, 2018
11e3e09
committing files after branch merge
cippy Jan 16, 2018
d0cea35
making the map array non static to allow having a second map (mainly …
cippy Jan 17, 2018
e9fc794
implementing containment corrections with E/Etrue in data calibration
cippy Jan 19, 2018
1d783f8
new macro to plot containment correction maps made with E/Etrue in MC
cippy Jan 19, 2018
c06f990
implementing containment corrections made with E/Etrue in MC
cippy Jan 19, 2018
d447e43
development for E/Etrue
cippy Feb 2, 2018
fe37c24
updates for E/Etrue
cippy Feb 4, 2018
91027d3
using merged 'calibMap.root'
cippy Feb 10, 2018
996e886
macros to do plots for E/Etrue
cippy Feb 10, 2018
ea4daf6
fixes
cippy Feb 10, 2018
8dfa235
add new flag to just merge fit maps without refitting
cippy Feb 10, 2018
276b6f2
developments for E/Etrue and implementation of E/Etrue corrections
cippy Feb 10, 2018
694619d
removing couts
cippy Feb 10, 2018
50c76a9
use TH12::FindBin to get bin nuber of E/Etrue correction map
cippy Feb 12, 2018
c9e4e2d
Pass many patterns and loop on them
cippy Feb 16, 2018
673d76f
Removing 4 files that are always problematic
cippy Feb 16, 2018
c9818fd
using array pf patterns
cippy Feb 16, 2018
9cf6de6
adding options for MC
cippy Feb 16, 2018
0b8c42c
using prefix to read from eos when eos is not mounted
cippy Feb 16, 2018
58bcd82
adding options to pass range of Z axis
cippy Feb 16, 2018
4b7f154
implementing E/Etrue correctons, improving tree variables's names and…
cippy Feb 16, 2018
c9b542e
improving fit range for E/Etrue; adding possibility to fold in SM
cippy Feb 16, 2018
9e6db5b
fixes, and saving root file with IC maps
cippy Feb 21, 2018
01b0100
fixes, and using std::vector for array variables
cippy Feb 21, 2018
5ff6489
create output folder and copy index.php
cippy Feb 26, 2018
e7c6dae
normalize IC starting from uncutted histogram
cippy Feb 27, 2018
9429ab9
polishing and fixes
cippy Apr 25, 2018
d836748
committing some stuff
cippy Apr 25, 2018
5276aea
headers
cippy Apr 25, 2018
88002d8
files used in some macros
cippy Apr 25, 2018
1416537
some sources: macros to do optimization studies (used in 2017, should…
cippy Apr 25, 2018
527543f
macros to do IC stuff
cippy Apr 28, 2018
8e435c7
list of MC V2 files
cippy Apr 28, 2018
0568091
fixed conversion of std::shared_ptr<const CaloCellGeometry*> to const…
cippy Apr 28, 2018
14c516f
fix
cippy Apr 28, 2018
964e66e
allow reading json from absolute afs path, without having to copy it …
cippy Apr 28, 2018
0317cb2
dd possibility to plot rooplot or canvas
cippy May 7, 2018
f37d92f
add option to skip DummyRechits producer (not working anymore at leas…
cippy May 7, 2018
890898f
comment debug lines
cippy May 7, 2018
4cfbf3f
comment debug lines
cippy May 7, 2018
fcd6690
check release version do decide if to ue DummyRechit producer
cippy May 9, 2018
c8a9ffa
improvements or updates
cippy May 9, 2018
d3e2aa4
some fixes in the macros
cippy May 16, 2018
1de5246
improving filter of files list with json. Keep track of used json, ad…
cippy May 26, 2018
bfc560b
fixes
cippy May 26, 2018
d557608
updates to use json from fill python cfg instead of running the filte…
cippy Jun 3, 2018
c671c3c
fix to use GetByToken (the fix was necessary in release > 10X, but ap…
cippy Jun 3, 2018
db3e7d6
fix
cippy Jul 9, 2018
f4bb664
fixes
cippy Jul 9, 2018
48af5eb
updates
cippy Jul 9, 2018
86d33c2
fixes and updates
cippy Jul 9, 2018
b4adf28
adding option to skip drawing and saving histograms (save only final …
cippy Jul 30, 2018
68f813d
fixes, and removing lines to skim DummyHits
cippy Sep 2, 2018
ab5c2dd
general polishing
cippy Sep 2, 2018
1098217
save for records
cippy Sep 7, 2018
50e2e8d
fixing issues born when moving to release 10_2_X from 10_1_1
cippy Sep 10, 2018
be6cbc2
large commit
cippy Dec 5, 2018
c0dd707
add names to sig and bkg fit components to allow usage later from sav…
cippy Dec 6, 2018
770d95d
new macro to compare 2 mass plots
cippy Dec 7, 2018
cd909d8
updating scripts to use condor, and other improvements
cippy Feb 13, 2019
81695e5
updates imported from 9_4_5
cippy Feb 24, 2019
7fe6ce7
simple script to restore files for hadd if something has failed
cippy Feb 26, 2019
a2413b8
porting from 94X, fix in mass fits and stuff on plotting macros
cippy Feb 27, 2019
2387d15
scripts to easily run macros
cippy Mar 7, 2019
2e3d20c
updates
cippy Mar 7, 2019
1f00bac
check kRecovered files before runnign hadd
cippy Mar 8, 2019
875a1d3
new script to filter files (1 every N)
cippy Mar 10, 2019
d96132a
improve plots, put everything in same canvas
cippy Mar 12, 2019
4d51032
small fixes
cippy Mar 12, 2019
64d8a96
new script to resubmit failed Fill using LSF
cippy Mar 16, 2019
7b58c4e
updates
cippy Mar 16, 2019
533ee52
small improvement
cippy Mar 16, 2019
f18d3ec
updates
cippy Mar 17, 2019
1086380
updates
cippy Mar 26, 2019
1dca8cd
updates
cippy Mar 26, 2019
22de680
updates
cippy Mar 26, 2019
625aced
fix
cippy Mar 27, 2019
24d789e
fix
cippy Apr 5, 2019
fe354c5
files for pi0 MC in 2018
cippy Apr 5, 2019
9737f71
backup
cippy Apr 6, 2019
bdb41a9
small fix to fill control distribution for EB only when subDetId == E…
cippy Apr 7, 2019
5233e24
fixes in CalibJobHandlerCondor.py and new scripts to make plots on th…
cippy Apr 12, 2019
82cda9e
several updates: better fits for CC with EoverEtrue, new script to re…
cippy May 4, 2019
739dd36
improving job submission and fits for E/Etrue folding SM
cippy May 13, 2019
0d0ca77
updates
cippy May 15, 2019
d03fb3c
updates
cippy May 19, 2019
40ee60a
big commit, several updates
cippy Jun 16, 2019
64883c6
some updates
cippy Jun 30, 2019
40b53cb
several fixes and improvements for condor and scripts
cippy Jul 20, 2019
2e4e2fa
allow to filter lists in the opposite way
cippy Aug 7, 2019
0d928ca
choose year dependent scale factor for E/Etrue CC
cippy Sep 13, 2019
eaae68c
update
cippy Sep 15, 2019
e75b84a
Fill part uses TH2 to store all the mass distribution vs crystal ID (…
cippy Sep 16, 2019
1762544
add threshold for number of failed fill to start recovery
cippy Sep 18, 2019
5eac7ea
improve memory usage, also remove useless histograms
cippy Sep 18, 2019
0822e33
fix bug
cippy Sep 18, 2019
d415a17
updates
cippy Oct 29, 2019
41bbd2b
improving scripts for plots
cippy Oct 30, 2019
f75f357
updates, and a fix in condor config file
cippy Nov 26, 2019
8d7965b
new scripts
cippy Nov 27, 2019
de2e8a1
script for plots comparing different years
cippy Dec 11, 2019
62923d2
updates
cippy Dec 11, 2019
30d4857
updating plots
cippy Feb 21, 2020
0b0239c
foo
cippy Feb 24, 2020
c05fd83
updates for plots
cippy Feb 25, 2020
0c9dfd1
fix usate of topology in new release 10_6_X
cippy Feb 25, 2020
89054bc
remove folder in output root files
cippy Mar 3, 2020
986400a
specify pi0 or eta in plots
cippy Mar 9, 2020
bde6f5d
removing some obsolete stuff and other things
cippy Jun 2, 2020
0137770
speeding up pairing of clusters to make pi0/eta
cippy Jun 5, 2020
532eded
optimizing code for speed
cippy Jun 10, 2020
68768af
optimizing code
cippy Aug 21, 2020
ef7e395
add functionality to check goodness of files on eos in each job, and …
cippy Aug 24, 2020
97211d5
improving command for submission using options
cippy Dec 23, 2020
1da77eb
small fixes
cippy Jan 24, 2021
a00ed37
Merge pull request #5 from cippy/106X_mciprian
emanueledimarco Jan 28, 2022
28da8ed
changes needed to barely compile in CMSSW_12_3_X
emanueledimarco Jan 28, 2022
7ad1c8b
general update: running in 123X CMSSW release now
emanueledimarco Feb 21, 2022
077ab65
move to non-legacy analyzer and producer, whatever it means (#38)
emanueledimarco Feb 21, 2022
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
57 changes: 38 additions & 19 deletions CalibTools/interface/EcalCalibMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class EcalCalibMapBase {
virtual float& coeff(const DetId& id) =0;
virtual float& operator[](const DetId& id) =0;
virtual const float& operator[](const DetId& id) const =0;
virtual void loadCalibMapFromFile(const char* cfile) =0;
virtual void loadCalibMapFromFile(const char* cfile = "", const bool useGenPhoton2forEoverEtrue = false) =0;
virtual int getNRegionsEB() =0;
virtual int getNRegionsEE() =0;
virtual ~EcalCalibMapBase(){}
};


Expand Down Expand Up @@ -70,12 +71,14 @@ class EcalCalibMap : public EcalCalibMapBase {
int getNRegionsEB() {return nRegionsEB;}
int getNRegionsEE() {return nRegionsEE;}

void loadCalibMapFromFile(const char* cfile);
void loadCalibMapFromFile(const char* cfile = "", const bool useGenPhoton2forEoverEtrue = false);
// void setCaloGeometry(ECALGeometry *geom);

private:
static float mapEB[Type::nRegions];
static float mapEE[Type::nRegionsEE];
/* static float mapEB[Type::nRegions]; */
/* static float mapEE[Type::nRegionsEE]; */
float mapEB[Type::nRegions];
float mapEE[Type::nRegionsEE];
static float bad_coeff;
static const uint32_t nRegionsEB = Type::nRegions;
static const uint32_t nRegionsEE = Type::nRegionsEE;
Expand All @@ -85,32 +88,48 @@ class EcalCalibMap : public EcalCalibMapBase {


template<typename Type>
void EcalCalibMap<Type>::loadCalibMapFromFile(const char* cfile)
void EcalCalibMap<Type>::loadCalibMapFromFile(const char* cfile, const bool useGenPhoton2forEoverEtrue)
{

std::cout << "[EcalCalibMap] :: loadCalibMapFromFile(" << std::string(cfile) << ") called" << std::endl;
// we are also implementing E/Etrue with MC, in which case we have maps for two different photons with E/Etrue instead of the pi0 mass
// in this case, useGenPhoton2forEoverEtrue = true implies loading the map for the second gen photon (the first one is stored in the map with the same
// name it would have if we were working with pi0 mass

std::cout << "FIT_EPSILON: [EcalCalibMap] :: photon " << (useGenPhoton2forEoverEtrue ? 2 : 1) << ", loadCalibMapFromFile(" << std::string(cfile) << ") called" << std::endl;
TFile* f = TFile::Open(cfile);
/// keep trying in case of network I/O problems
for(int iTrial=0; iTrial<10 && !f; iTrial++)
{
std::cout << "[EcalCalibMap] :: Warning: could not open calibMap.root (trial #" << iTrial << ")" << std::endl;
std::cout << "FIT_EPSILON : [EcalCalibMap] :: Warning: could not open calibMap.root (trial #" << iTrial << ")" << std::endl;
std::cout << "[EcalCalibMap] :: '-- Could be a network issue. Trying again in 30s..." << std::endl;
sleep(30);

f = TFile::Open(cfile);
}
if(!f) throw cms::Exception("LoadCalibMap") << "[EcalCalibMap] :: cannot open calibMap.root after 10 trials in 300s\n";
else std::cout << "[EcalCalibMap] :: " << std::string(cfile) << " successfully opened" << std::endl;
else std::cout << "FIT_EPSILON: [EcalCalibMap] :: " << std::string(cfile) << " successfully opened" << std::endl;

// TH2F* hmap = (TH2F*) f->Get("calibMap");
TH2F* hmap = (TH2F*) f->Get("calibMap_EB");
TH2F* hmap_EEp = (TH2F*) f->Get("calibMap_EEp");
TH2F* hmap_EEm = (TH2F*) f->Get("calibMap_EEm");
if(!hmap) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EB in the file provided\n";
if(!hmap_EEp) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEp in the file provided\n";
if(!hmap_EEm) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEm in the file provided\n";
TH2F* hmap = nullptr;
TH2F* hmap_EEp = nullptr;
TH2F* hmap_EEm = nullptr;
if (useGenPhoton2forEoverEtrue) {
hmap = (TH2F*) f->Get("calibMap_EB_g2");
hmap_EEp = (TH2F*) f->Get("calibMap_EEp_g2");
hmap_EEm = (TH2F*) f->Get("calibMap_EEm_g2");
if(!hmap) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EB_g2 in the file provided\n";
if(!hmap_EEp) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEp_g2 in the file provided\n";
if(!hmap_EEm) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEm_g2 in the file provided\n";
} else {
hmap = (TH2F*) f->Get("calibMap_EB");
hmap_EEp = (TH2F*) f->Get("calibMap_EEp");
hmap_EEm = (TH2F*) f->Get("calibMap_EEm");
if(!hmap) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EB in the file provided\n";
if(!hmap_EEp) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEp in the file provided\n";
if(!hmap_EEm) throw cms::Exception("LoadCalibMap") << "cannot find TH2F::calibMap_EEm in the file provided\n";
}

std::cout << "loading constants from TH2F::calibMap in <" << cfile << "> ..." << std::endl;
std::cout << "FIT_EPSILON: loading constants from TH2F::calibMap in <" << cfile << "> ..." << std::endl;

for(int ix=1; ix<= hmap->GetXaxis()->GetNbins(); ++ix) {
if(ix==86) continue;
Expand All @@ -121,7 +140,7 @@ void EcalCalibMap<Type>::loadCalibMapFromFile(const char* cfile)
}
}

std::cout << "loading constants from TH2F::calibMapEE in <" << cfile << "> ..." << std::endl;
std::cout << "FIT_EPSILON: loading constants from TH2F::calibMapEE in <" << cfile << "> ..." << std::endl;

for(int jR=0; jR<EEDetId::kSizeForDenseIndexing; jR++)
{
Expand All @@ -145,8 +164,8 @@ void EcalCalibMap<Type>::loadCalibMapFromFile(const char* cfile)
// }


template<typename Type> float EcalCalibMap<Type>::mapEB[Type::nRegions];
template<typename Type> float EcalCalibMap<Type>::mapEE[Type::nRegionsEE];
template<typename Type> float EcalCalibMap<Type>::bad_coeff;
/* template<typename Type> float EcalCalibMap<Type>::mapEB[Type::nRegions]; */
/* template<typename Type> float EcalCalibMap<Type>::mapEE[Type::nRegionsEE]; */
template<typename Type> float EcalCalibMap<Type>::bad_coeff;

#endif
1 change: 1 addition & 0 deletions CalibTools/interface/EcalRegionalCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class EcalRegionalCalibrationBase{
virtual std::string printType() =0;
virtual std::vector<DetId> allDetIdsInEBRegion(uint32_t iR) =0;
virtual std::vector<DetId> allDetIdsInEERegion(uint32_t iR) =0;
virtual ~EcalRegionalCalibrationBase(){}
};

template<class Type> class EcalRegionalCalibration : public EcalRegionalCalibrationBase {
Expand Down
1 change: 1 addition & 0 deletions CalibTools/interface/EndcapTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class EndcapTools
//void setCaloGeometry(string & geometryName);

static const int N_RING_ENDCAP = 78;
static const int N_RING_ENDCAP_SIDE = 39;

private:
static void initializeFromGeometry();
Expand Down
2 changes: 1 addition & 1 deletion CalibTools/src/ECALGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ECALGeometry::ECALGeometry(TFile* f) {

GlobalPoint ECALGeometry::getPosition(DetId id, float depth) const {
std::map<DetId,GlobalPoint>::const_iterator it = posMap.find(id);
std::map<DetId,GlobalVector>::const_iterator iax = axisMap.find(id);
//std::map<DetId,GlobalVector>::const_iterator iax = axisMap.find(id);
if( it != posMap.end() )
return it->second + depth*getAxis(id).unit();
else throw( std::exception() );
Expand Down
16 changes: 8 additions & 8 deletions CalibTools/src/EndcapTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int EndcapTools::getRingIndex(DetId id)

EEDetId eid(id);
int endcapRingIndex = endcapRingIndex_[eid.ix()-1][eid.iy()-1];
if (eid.zside() == 1) endcapRingIndex += N_RING_ENDCAP/2;
if (eid.zside() == 1) endcapRingIndex += N_RING_ENDCAP_SIDE;
return endcapRingIndex;
}

Expand All @@ -57,8 +57,8 @@ std::vector<DetId> EndcapTools::getDetIdsInRing(int etaIndex)
if (!isInitializedFromGeometry_)
initializeFromGeometry();

int zside= (etaIndex < (N_RING_ENDCAP/2) ) ? -1 : 1;
int eeEtaIndex = (etaIndex)%(N_RING_ENDCAP/2);
int zside= (etaIndex < N_RING_ENDCAP_SIDE ) ? -1 : 1;
int eeEtaIndex = (etaIndex)%N_RING_ENDCAP_SIDE;

for (int ix=0;ix<EEDetId::IX_MAX;++ix)
for (int iy=0;iy<EEDetId::IY_MAX;++iy)
Expand Down Expand Up @@ -118,20 +118,20 @@ void EndcapTools::initializeFromGeometry()
//std::cout<<"EE Xtal, |eta| is "<<fabs(cellGeometry->getPosition().eta())<<std::endl;
}

float eta_ring[N_RING_ENDCAP/2];
float eta_ring[N_RING_ENDCAP_SIDE];

/// span half of the y axis (x value is fixed)
for (int ring=0; ring<N_RING_ENDCAP/2; ++ring)
for (int ring=0; ring<N_RING_ENDCAP_SIDE; ++ring)
eta_ring[ring]=m_cellPosEta[ring][50];

double etaBoundary[N_RING_ENDCAP/2 + 1];
double etaBoundary[N_RING_ENDCAP_SIDE + 1];
etaBoundary[0]=1.47;
etaBoundary[N_RING_ENDCAP/2]=4.0;

for (int ring=1; ring<N_RING_ENDCAP/2; ++ring)
for (int ring=1; ring<N_RING_ENDCAP_SIDE; ++ring)
etaBoundary[ring]=(eta_ring[ring]+eta_ring[ring-1])/2.;

for (int ring=0; ring<N_RING_ENDCAP/2; ring++){
for (int ring=0; ring<N_RING_ENDCAP_SIDE; ring++){
// std::cout<<"***********************EE ring: "<<ring<<" eta "<<(etaBoundary[ring] + etaBoundary[ring+1])/2.<<std::endl;
for (int ix=0; ix<EEDetId::IX_MAX; ix++)
for (int iy=0; iy<EEDetId::IY_MAX; iy++)
Expand Down
11 changes: 7 additions & 4 deletions DumpCaloGeometry/src/DumpCaloGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"

// Geometry
#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
#include "Geometry/Records/interface/CaloTopologyRecord.h"
#include "Geometry/CaloTopology/interface/CaloTopology.h"
#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
Expand Down Expand Up @@ -114,7 +114,10 @@ void DumpCaloGeometry::analyze(const Event& iEvent,

for (std::vector<DetId>::iterator i=eb_ids.begin(); i!=eb_ids.end(); i++) {
n++;
const CaloCellGeometry* cell=geoEB->getGeometry(*i);
// since at least CMSSW_10_1_1, the object geoEB->getGeometry(*i) return an std::shared_ptr<const CaloCellGeometry>
// probably the type was changed wrt to release 94X, because now code does not compile, saying cannot convert it to const CaloCellGeometry*
// the solution is to use get() method of std::shared_ptr
const CaloCellGeometry* cell = geoEB->getGeometry(*i).get();

id = i->rawId();
xtalPos[0] = dynamic_cast<const TruncatedPyramid*>(cell)->getPosition(0.).x();
Expand All @@ -130,7 +133,7 @@ void DumpCaloGeometry::analyze(const Event& iEvent,

for (std::vector<DetId>::iterator i=ee_ids.begin(); i!=ee_ids.end(); i++) {
n++;
const CaloCellGeometry* cell=geoEE->getGeometry(*i);
const CaloCellGeometry* cell= geoEE->getGeometry(*i).get();

id = i->rawId();
xtalPos[0] = dynamic_cast<const TruncatedPyramid*>(cell)->getPosition(0.).x();
Expand All @@ -147,7 +150,7 @@ void DumpCaloGeometry::analyze(const Event& iEvent,

for (std::vector<DetId>::iterator i=es_ids.begin(); i!=es_ids.end(); i++) {
n++;
const CaloCellGeometry* cell=geoES->getGeometry(*i);
const CaloCellGeometry* cell=geoES->getGeometry(*i).get();
GlobalPoint position = cell->getPosition();

id = i->rawId();
Expand Down
Loading