Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7668ed5
Update dumpTree with rawid and resized branches
previsualconsent Jul 1, 2015
d2c5b1a
added option to not store events
previsualconsent Jul 2, 2015
778d68a
simplified dump status
previsualconsent Jul 7, 2015
d83b16a
added getMeanTimeAboveEnergy to EcalCrystalTimingCalibration
previsualconsent Jul 7, 2015
8ef8b1c
added energyCut histograms
previsualconsent Jul 7, 2015
d55384c
added options for testCAF.sh
previsualconsent Jul 7, 2015
64e067a
added calibration and energy stability trees
previsualconsent Jul 8, 2015
1f20d7a
added elecID,iRing,index to output trees, fixed isStableInEnergy to …
previsualconsent Jul 10, 2015
5c9d277
tree2txt cleanup
previsualconsent Jul 10, 2015
a16a510
new customPalette
previsualconsent Jul 10, 2015
9cfd716
made time diff with step n-1 and 0
previsualconsent Jul 13, 2015
6b9d530
fixed const errors
previsualconsent Jul 13, 2015
a7120b2
added json file usage
previsualconsent Jul 13, 2015
6a70fd7
added txt2tree.py
previsualconsent Jul 13, 2015
b02ccea
added back in statistic check
previsualconsent Jul 13, 2015
e100ac4
added getNumWithinNSigma
previsualconsent Jul 14, 2015
70eb519
Added some plots
previsualconsent Jul 14, 2015
3fdcd17
don't store nan's for calibration, made getXXXWithinSigma break if we…
previsualconsent Jul 14, 2015
cca0620
more plotting
previsualconsent Jul 14, 2015
bba835f
some das scripts
previsualconsent Jul 15, 2015
f35794c
fixed jsonfile
previsualconsent Jul 15, 2015
bfec7ca
fixed for lsf use of jsonFile
previsualconsent Jul 16, 2015
d0285ab
updates to timing plot scripts
previsualconsent Jul 16, 2015
ac52568
added scripts for reconstructing
previsualconsent Jul 17, 2015
dd72571
comment out reco in config file
previsualconsent Jul 18, 2015
729f1e1
more plots
previsualconsent Jul 20, 2015
374dfef
Added function to get the old calibration and compare time plots agai…
previsualconsent Jul 21, 2015
5d25a1c
Chnaged over from Looper to filter
previsualconsent Jul 21, 2015
3a906b7
now can submit diff config files and also run over a file list
previsualconsent Jul 22, 2015
0de4d1a
updated ploting for new output file structure and removed some nonsense
previsualconsent Jul 22, 2015
c2da05d
fixes for making plots look better
previsualconsent Jul 22, 2015
eb5659c
added ccu plots
previsualconsent Jul 22, 2015
378a14a
added plots for CCU correction
previsualconsent Jul 23, 2015
9d601e6
plots
previsualconsent Jul 24, 2015
49380d0
added crystalmap.txt
previsualconsent Jul 27, 2015
4f642d3
made some plotting codes with a library in loadOldCalib
previsualconsent Jul 29, 2015
2d721ca
fixed issues with crystalmap.txt
previsualconsent Jul 29, 2015
212daa3
merged reco and analysis config file
previsualconsent Jul 29, 2015
e2e4fea
dump Calibrations was missing rawid for EE
previsualconsent Jul 29, 2015
420d346
added options for shifting the minimum energy threshold
previsualconsent Jul 22, 2015
c0aa4b7
submit script final
previsualconsent Jul 22, 2015
0728102
split energyThreshold into EE and EB
previsualconsent Jul 29, 2015
e7682bc
script/testCAF.sh tells cmsRun to do the RECO or not
previsualconsent Aug 4, 2015
d4e4973
plotting
previsualconsent Aug 4, 2015
5327ca6
made comments for the cfg file in documentation
previsualconsent Aug 4, 2015
fec0bcf
changed docs to refer to my repo
previsualconsent Aug 4, 2015
97f997c
plots for dumpTree
previsualconsent Aug 6, 2015
36160f8
added filter for rechit flags and energies
previsualconsent Aug 6, 2015
a9fdc43
have RECO output only save the selected rechits
previsualconsent Aug 6, 2015
2122ec4
updated crystalmap; implemented more plotting macros, new tool runInf…
previsualconsent Sep 30, 2015
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
74,934 changes: 74,934 additions & 0 deletions EcalTiming/data/crystalmap.txt

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions EcalTiming/doc/AlCaPhiSymStream_test.doc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@
Testing file:
\verbatim
file=root://eoscms//eos/cms/store/data/Run2015A/AlCaPhiSym/RAW/v1/000/246/908/00000/C0DA4527-2F0A-E511-ADFD-02163E014349.root
cmsRun test/ ecalTime_fromAlcaStream_cfg.py files=root://eoscms/$file
cmsRun test/ecalTime_fromAlcaStream_cfg.py files=root://eoscms/$file
\endverbatim

The code is in debug mode that have to be switched off
## Options for `cmsRun test/ecalTime_fromAlcaStream_cfg.py`
Options | Default | Description
------- | ------- | -------
files | "" | input files (can be RAW if step contains "RECO")
output | "" | output files. If TIME in step, it contains the calibration trees, otherwise it will be the RECO files.
maxEvents | -1 | # of events to run over
jsonFile |"" | path to the json file which designates which lumisections to use
step |"RECOTIMEANALYSIS" | Do reco, time analysis or both, RECO or TIMEANALYSIS or RECOTIMEANALYSIS
offset |0.0 | add this to each crystal time, (this was used in splash analysis, should probably be removed)
minEnergyEB | 0.0 | add this to minimum energy threshold in EB (0.520 GeV)
minEnergyEE | 0.0 | add this to minimum energy threshold in EE (which is a function of iRing)
isSplash | 0 | 0=false, 1=true, performs RECO as splash data and shifts timing in analyzer by TOF difference
streamName | "AlCaPhiSym" | type of stream, changes RECO path: AlCaPhiSym or AlCaP0


The script `scripts/testCAF.sh` automatically can run over RAW files for specific runs, setting the options above appropriately.
Probably should use it as a template rather than running it as is.
*/
7 changes: 4 additions & 3 deletions EcalTiming/doc/instructions.doc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ scram project CMSSW_7_4_2
cd CMSSW_7_4_2/src
cmsenv
git cms-merge-topic shervin86:iRingInSubdet
git clone git@github.com:ECALELFS/EcalTiming.git
git clone git@github.com:ECALELFS/PhiSym.git
git clone git@github.com:previsualconsent/EcalTiming.git
cd EcalTiming
checkout energystability
scram b -j16
\endverbatim

Expand All @@ -33,4 +34,4 @@ cd -


Go back to \ref index
*/
*/
43 changes: 24 additions & 19 deletions EcalTiming/interface/EcalCrystalTimingCalibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
* This class contains all the timing information for a single crystal
*/

//Defines for Dump Status (reason for dumping each crystal
//Defines for Dump Status (reason for dumping each crystal)
#define DS_NONE 0x00
#define DS_HIGH_SKEW 0x01
#define DS_UNSTABLE_EN 0x02
#define DS_CCU_OOT 0x04
#define DS_EB_RING 0x08
#define DS_EEm_RING 0x10
#define DS_EEp_RING 0x20
#define DS_EB_CRYS 0x40
#define DS_EE_CRYS 0x80
#define DS_RING 0x08
#define DS_CRYS 0x10


class EcalCrystalTimingCalibration
Expand All @@ -33,9 +30,11 @@ class EcalCrystalTimingCalibration
unsigned long int _num; ///< number of timingEvents;

float _sumE; ///< scalar sum of the energy of each timingEvent: needed for average energy
bool _storingEvents;

mutable std::map<float, float> _sumWithinNSigma, _sum2WithinNSigma, _sum3WithinNSigma, _sumEWithinNSigma; ///< variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails)
mutable std::map<float, unsigned int> _numWithinNSigma; ///< variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails)

std::map<float, float> _sumWithinNSigma, _sum2WithinNSigma, _sum3WithinNSigma, _sumEWithinNSigma; ///< variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails)
std::map<float, unsigned int> _numWithinNSigma; ///< variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails)

std::vector<EcalTimingEvent> timingEvents; ///< vector containing all the events for this crystal
std::vector<EcalTimingEvent>::iterator maxChi2Itr;
Expand All @@ -45,7 +44,7 @@ class EcalCrystalTimingCalibration
/// default constructor
EcalCrystalTimingCalibration(bool weightMean = true) :
//_detId(),
_sum(0), _sum2(0), _num(0), _sumE(0)
_sum(0), _sum2(0), _num(0), _sumE(0), _storingEvents(true)
//totalChi2(-1),
//useWeightedMean(weightMean)
{
Expand All @@ -57,6 +56,7 @@ class EcalCrystalTimingCalibration
};
inline float mean() const
{
if(!_num) return -999.f;
return _sum / _num;
}; ///< average time (mean of the time distribution)
inline float stdDev() const ///< standard deviation of the time distribution
Expand All @@ -79,9 +79,11 @@ class EcalCrystalTimingCalibration
/* } */
//float totalChi2;

float getMeanWithinNSigma(float sigma, float maxRange); ///< returns the mean time within abs(mean+ n * stdDev) to reject tails
float getStdDevWithinNSigma(float sigma, float maxRange); ///< returns the stdDev calculated within abs(mean+ n * stdDev) to reject tails
float getSkewnessWithinNSigma(float sigma, float maxRange); ///< returns the skewness calculated within abs(mean+ n * stdDev) to reject tails
float getMeanWithinNSigma(float sigma, float maxRange) const; ///< returns the mean time within abs(mean+ n * stdDev) to reject tails
float getStdDevWithinNSigma(float sigma, float maxRange) const; ///< returns the stdDev calculated within abs(mean+ n * stdDev) to reject tails
float getNumWithinNSigma(float sigma, float maxRange) const; ///< returns the num calculated within abs(mean+ n * stdDev) to reject tails
float getMeanErrorWithinNSigma(float sigma, float maxRange) const; ///< returns the error on the mean calculated within abs(mean+ n * stdDev) to reject tails
float getSkewnessWithinNSigma(float sigma, float maxRange) const; ///< returns the skewness calculated within abs(mean+ n * stdDev) to reject tails

friend std::ostream& operator<< (std::ostream& os, const EcalCrystalTimingCalibration& s)
{
Expand All @@ -90,9 +92,9 @@ class EcalCrystalTimingCalibration
}

/// add new event for this crystal
inline bool add(EcalTimingEvent te_)
inline bool add(EcalTimingEvent te_, bool storeEvent = true)
{
return insertEvent(te_);
return insertEvent(te_,storeEvent);
}
inline void clear()
{
Expand All @@ -108,24 +110,27 @@ class EcalCrystalTimingCalibration
timingEvents.clear();
}

void dumpToTree(TTree *tree, int ix_, int iy_, int iz_, unsigned int status_, unsigned int elecID_ = 0); ///< dump the full set of events in a TTree: need an empty tree
void dumpToTree(TTree *tree, int ix_, int iy_, int iz_, unsigned int status_, unsigned int elecID_, int iRing_); ///< dump the full set of events in a TTree: need an empty tree
void dumpCalibToTree(TTree * tree, int rawid_, int ix_, int iy_, int iz_, unsigned int elecID_, int iRing_) const; ///< dump the callibratoin to the tree

/// checks if the time measurement is stable changing the min energy threshold
bool isStableInEnergy(float min, float max, float step);
bool isStableInEnergy(float min, float max, float step, std::vector< std::pair<float, EcalCrystalTimingCalibration*> > &ret);

private:
void calcAllWithinNSigma(float n_sigma, float maxRange = 10); ///< calculate sum, sum2, sum3, n for time if time within n x stdDev and store the result
void calcAllWithinNSigma(float n_sigma, float maxRange = 10) const; ///< calculate sum, sum2, sum3, n for time if time within n x stdDev and store the result
// since the values are stored, the calculation is done only once with only one loop over the events

/// \todo weighted average by timeError
bool insertEvent(EcalTimingEvent te_)
bool insertEvent(EcalTimingEvent te_, bool storeEvent)
{
if(!storeEvent) _storingEvents = false;
if(te_.timeError() > 0 && te_.timeError() < 1000 && te_.timeError() < 3) { //exclude values with wrong timeError estimation
_sum += te_.time();
_sum2 += te_.time() * te_.time();
_sumE += te_.energy();
_num++;
timingEvents.push_back(te_);
if(_storingEvents)
timingEvents.push_back(te_);
//updateChi2();
return true;
} else {
Expand Down
Loading