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

New Ecal Local Reconstruction with Multifit #5197

Merged
merged 40 commits into from Sep 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6fed59e
Add (and activate) multifit reconstruction
bendavid Aug 30, 2014
602e95f
add the cfg starting from raw
emanueledimarco Aug 31, 2014
ff1836a
- Add the 10 pulses amplitudes and uncertainties to the transient unc…
emanueledimarco Sep 1, 2014
06932c1
change the constents of the 13 bits reserved to OOT energy to the ene…
emanueledimarco Sep 1, 2014
5ff7e48
change the uncalibrated rechit dataformats for the migration to the m…
emanueledimarco Sep 1, 2014
ea51885
change the uncalibrated rechit dataformats for the migration to the m…
emanueledimarco Sep 1, 2014
e269455
change the container for the alternative amplitude reco after the mul…
emanueledimarco Sep 1, 2014
ee8913e
migration of the Ecal(Uncalib)RecHit dataformats to the new format af…
emanueledimarco Sep 1, 2014
37ad02f
cleanup the cfg
emanueledimarco Sep 1, 2014
86eaba7
add some code to set the flags of kPoorReco and kOutOfTime (the secon…
emanueledimarco Sep 1, 2014
b9a6bb3
comment out the kPoorReco flag
emanueledimarco Sep 1, 2014
55a061c
migrate from minuit to inline TMatrix/TVector-based NNLS algorithm
bendavid Sep 1, 2014
3913455
restore deprecated accessors to avoid interface incompatibility
bendavid Sep 1, 2014
5dce33e
fix indices for out of time energy in case not all bxs are active (mi…
bendavid Sep 1, 2014
0a6ccaf
further performance optimizations
bendavid Sep 1, 2014
f5d71ab
make minimizer a data member of the algo so that memory is only alloc…
bendavid Sep 2, 2014
6f36fd9
move the inputs to the python files
emanueledimarco Sep 2, 2014
e2ba69f
Merge branch 'ecalMultifit_minimal720p4' of github.com:bendavid/cmssw…
emanueledimarco Sep 2, 2014
b46493e
remove the uncertainties on the OOT pulses amplitudes
emanueledimarco Sep 2, 2014
6a0fd2a
add minos-like uncertainty computation
bendavid Sep 2, 2014
005de8f
cleanup printout statements (and issue LogWarnings where appropriate)
bendavid Sep 2, 2014
c39179b
bug fix on the OOT BXs amplitude assignement
emanueledimarco Sep 3, 2014
5c933d2
change the time estimation with the weights, once subtracted the OOT PU
emanueledimarco Sep 3, 2014
b6f46b3
fix remaining small problem with bx indices
bendavid Sep 3, 2014
8426f04
pass set by const reference
bendavid Sep 4, 2014
0dee3f1
update pulse templates and covariance matrices
bendavid Sep 4, 2014
491f225
fix input collections for default sequnce
bendavid Sep 4, 2014
7b25da1
implement the weights for time reco, but turned off and configurable
emanueledimarco Sep 4, 2014
f96c361
Merge branch 'ecalMultifit_minimal720p4' of github.com:bendavid/cmssw…
emanueledimarco Sep 4, 2014
8a14d87
fix collection names in validation sequence
bendavid Sep 4, 2014
8f1563a
allow turning off the calculation of the uncertainties
emanueledimarco Sep 5, 2014
b2cdac5
allow turning off the calculation of the uncertainties
emanueledimarco Sep 5, 2014
a54efe1
add the time profiler service
emanueledimarco Sep 5, 2014
69720c9
fix remaining input collection names
bendavid Sep 5, 2014
0c02475
fix event content for ecal local reco
bendavid Sep 6, 2014
b745126
fix typo in unit test
bendavid Sep 6, 2014
ee498a7
move to the new multifit ECAL uncalibrated rechit collection for phys…
emanueledimarco Sep 6, 2014
17118ec
remove obsolete accessors from EcalRecHit and ensure consistent behav…
bendavid Sep 8, 2014
fa66873
revert class version and iorules gymnastics which were not working pr…
bendavid Sep 9, 2014
24ef838
restore only the class version increment for the EcalRecHit
bendavid Sep 9, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Configuration/StandardSequences/python/Reconstruction_cff.py
Expand Up @@ -101,7 +101,8 @@
modulesToRemove.append(dt1DCosmicRecHits)
modulesToRemove.append(csc2DRecHits)
modulesToRemove.append(rpcRecHits)
modulesToRemove.append(ecalGlobalUncalibRecHit)
#modulesToRemove.append(ecalGlobalUncalibRecHit)
modulesToRemove.append(ecalMultiFitUncalibRecHit)
modulesToRemove.append(ecalDetIdToBeRecovered)
modulesToRemove.append(ecalRecHit)
modulesToRemove.append(ecalCompactTrigPrim)
Expand Down
8 changes: 4 additions & 4 deletions DQM/EcalMonitorTasks/python/CollectionTags_cfi.py
Expand Up @@ -22,12 +22,12 @@
PnDiodeDigi = cms.untracked.InputTag("ecalDigis"),
TrigPrimDigi = cms.untracked.InputTag("ecalDigis", "EcalTriggerPrimitives"),
TrigPrimEmulDigi = cms.untracked.InputTag("valEcalTriggerPrimitiveDigis"),
EBUncalibRecHit = cms.untracked.InputTag("ecalGlobalUncalibRecHit", "EcalUncalibRecHitsEB"),
EEUncalibRecHit = cms.untracked.InputTag("ecalGlobalUncalibRecHit", "EcalUncalibRecHitsEE"),
EBUncalibRecHit = cms.untracked.InputTag("ecalMultiFitUncalibRecHit", "EcalUncalibRecHitsEB"),
EEUncalibRecHit = cms.untracked.InputTag("ecalMultiFitUncalibRecHit", "EcalUncalibRecHitsEE"),
# EBLaserLedUncalibRecHit = cms.untracked.InputTag("ecalLaserLedUncalibRecHit", "EcalUncalibRecHitsEB"),
# EELaserLedUncalibRecHit = cms.untracked.InputTag("ecalLaserLedUncalibRecHit", "EcalUncalibRecHitsEE"),
EBLaserLedUncalibRecHit = cms.untracked.InputTag("ecalGlobalUncalibRecHit", "EcalUncalibRecHitsEB"),
EELaserLedUncalibRecHit = cms.untracked.InputTag("ecalGlobalUncalibRecHit", "EcalUncalibRecHitsEE"),
EBLaserLedUncalibRecHit = cms.untracked.InputTag("ecalMultiFitUncalibRecHit", "EcalUncalibRecHitsEB"),
EELaserLedUncalibRecHit = cms.untracked.InputTag("ecalMultiFitUncalibRecHit", "EcalUncalibRecHitsEE"),
EBTestPulseUncalibRecHit = cms.untracked.InputTag("ecalTestPulseUncalibRecHit", "EcalUncalibRecHitsEB"),
EETestPulseUncalibRecHit = cms.untracked.InputTag("ecalTestPulseUncalibRecHit", "EcalUncalibRecHitsEE"),
EBRecHit = cms.untracked.InputTag("ecalRecHit", "EcalRecHitsEB"),
Expand Down
2 changes: 1 addition & 1 deletion DQM/EcalMonitorTasks/src/EnergyTask.cc
Expand Up @@ -53,7 +53,7 @@ namespace ecaldqm
if(isPhysicsRun_ && hitItr->checkFlagMask(notGood)) continue;
if(!isPhysicsRun_ && hitItr->checkFlagMask(neitherGoodNorOOT)) continue;

float energy(isPhysicsRun_ ? hitItr->energy() : hitItr->outOfTimeEnergy());
float energy(hitItr->energy());

if(energy < 0.) continue;

Expand Down
4 changes: 2 additions & 2 deletions DQM/Integration/python/test/ecal_dqm_sourceclient-live_cfg.py
Expand Up @@ -27,7 +27,7 @@
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("Geometry.EcalMapping.EcalMapping_cfi")
process.load("Geometry.EcalMapping.EcalMappingRecord_cfi")
process.load("RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHit_cfi")
process.load("RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi")
process.load("RecoLocalCalo.EcalRecProducers.ecalDetIdToBeRecovered_cfi")
process.load("RecoLocalCalo.EcalRecProducers.ecalRecHit_cfi")
process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi")
Expand Down Expand Up @@ -168,7 +168,7 @@
### Sequences ###

process.ecalPreRecoSequence = cms.Sequence(process.ecalDigis)
process.ecalRecoSequence = cms.Sequence((process.ecalGlobalUncalibRecHit+process.ecalDetIdToBeRecovered+process.ecalRecHit)+(process.simEcalTriggerPrimitiveDigis+process.gtDigis)+(process.hybridClusteringSequence+process.multi5x5ClusteringSequence))
process.ecalRecoSequence = cms.Sequence((process.ecalMultiFitUncalibRecHit+process.ecalDetIdToBeRecovered+process.ecalRecHit)+(process.simEcalTriggerPrimitiveDigis+process.gtDigis)+(process.hybridClusteringSequence+process.multi5x5ClusteringSequence))
process.multi5x5ClusteringSequence = cms.Sequence(process.multi5x5BasicClustersCleaned+process.multi5x5SuperClustersCleaned+process.multi5x5BasicClustersUncleaned+process.multi5x5SuperClustersUncleaned+process.multi5x5SuperClusters)
process.hybridClusteringSequence = cms.Sequence(process.cleanedHybridSuperClusters+process.uncleanedHybridSuperClusters+process.hybridSuperClusters+process.correctedHybridSuperClusters+process.uncleanedOnlyCorrectedHybridSuperClusters)

Expand Down
4 changes: 2 additions & 2 deletions DQM/Integration/rcms/eb_dqm_sourceclient-live_cfg.py
Expand Up @@ -125,8 +125,8 @@
if (onlyEE == 1) :
process.ecalEBunpacker.FEDs = [ 601, 602, 603, 604, 605, 606, 607, 608, 609, 646, 647, 648, 649, 650, 651, 652, 653, 654 ]

import RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHit_cfi
process.ecalUncalibHit = RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHit_cfi.ecalGlobalUncalibRecHit.clone()
import RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi
process.ecalUncalibHit = RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi.ecalMultiFitUncalibRecHit.clone()

import RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHit_cfi
process.ecalUncalibHit1 = RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHit_cfi.ecalFixedAlphaBetaFitUncalibRecHit.clone()
Expand Down
4 changes: 2 additions & 2 deletions DQM/Integration/rcms/ee_dqm_sourceclient-live_cfg.py
Expand Up @@ -125,8 +125,8 @@
if (onlyEE == 1) :
process.ecalEBunpacker.FEDs = [ 601, 602, 603, 604, 605, 606, 607, 608, 609, 646, 647, 648, 649, 650, 651, 652, 653, 654 ]

import RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHit_cfi
process.ecalUncalibHit = RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHit_cfi.ecalGlobalUncalibRecHit.clone()
import RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi
process.ecalUncalibHit = RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi.ecalMultiFitUncalibRecHit.clone()

import RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHit_cfi
process.ecalUncalibHit1 = RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHit_cfi.ecalFixedAlphaBetaFitUncalibRecHit.clone()
Expand Down
18 changes: 7 additions & 11 deletions DataFormats/EcalRecHit/interface/EcalRecHit.h
Expand Up @@ -107,7 +107,7 @@ class EcalRecHit {

/* the new bit structure
* 0..6 - chi2 in time events (chi2()), offset=0, width=7
* 8..20 - energy in out-of-time (outOfTimeEnergy()), offset=8, width=13
* 8..20 - energy uncertainty, offset=8, width=13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anyone actually using these bits?
If they are useful, then shouldn't there be some support for the previous version?
As is, hits created with the old version of the code will have some irrelevant values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dr15Jones is it possible to increase a classversion if the data members are unchanged?
Here, packing of some useful data is done in an extra_ data member.

If version support were needed, I guess a solution would be to create transient data members (ootEnergy, energyError) and fill them depending on the version.

SUSYBSMAnalysis/HSCP/src/BetaCalculatorECAL.cc is in for a little surprise at some point soon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One can change the version number even without changing data members. I think it was intended for just such behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slava77 Since the ecalRechit collection is permanent in the AOD, we recycled the packed bits used for the OOT energy for the energy uncertainty. We will remove the method returning 0 so people won't be confused. On the usefulness of the kOutOfTime flag: if the algorithm is proven to work as expected, it will become obsolete and be dropped. It may be still needed for HLT if we don't manage to speedup the code enough.

It makes sense to change the class version then. Note that the class version for DataFormats/EcalUncalibratedRecHit is changed because we added some extra data members.

* 24..31 - timeError(), offset=24, width=8
*/
float chi2() const {
Expand All @@ -123,18 +123,17 @@ class EcalRecHit {
uint32_t rawChi2 = lround(chi2 / 64. * ((1<<7)-1));
extra_ = setMasked(extra_, rawChi2, 0, 7);
}


float outOfTimeEnergy() const {

float energyError() const {
uint32_t rawEnergy = getMasked(extra_, 8, 13);
uint16_t exponent = rawEnergy >> 10;
uint16_t significand = ~(0xE<<9) & rawEnergy;
return (float) significand*pow(10,exponent-5);
}

// set the energy for out of time events
// set the energy uncertainty
// (only energy >= 0 will be stored)
void setOutOfTimeEnergy(float energy) {
void setEnergyError(float energy) {
uint32_t rawEnergy = 0;
if (energy > 0.001) {
uint16_t exponent = lround(floor(log10(energy))) + 3;
Expand Down Expand Up @@ -164,10 +163,7 @@ class EcalRecHit {
void setTimeError(uint8_t timeErrBits) {
extra_ = setMasked(extra_, timeErrBits & 0xFF, 24, 8);
}

float outOfTimeChi2() const { return 0; }
void setOutOfTimeChi2(short chi2) { /* not used */ }


/// set the flags (from Flags or ESFlags)
void setFlag(int flag) {flagBits_|= (0x1 << flag);}
void unsetFlag(int flag) {flagBits_ &= ~(0x1 << flag);}
Expand Down Expand Up @@ -209,7 +205,7 @@ class EcalRecHit {
/// store rechit condition (see Flags enum) in a bit-wise way
uint32_t flagBits_;

// packed uint32_t for timeError, chi2, outOfTimeEnergy
// packed uint32_t for timeError, chi2, energyError
uint32_t extra_;
};

Expand Down
34 changes: 17 additions & 17 deletions DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h
Expand Up @@ -3,6 +3,7 @@

#include <vector>
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/EcalDigi/interface/EcalDataFrame.h"

class EcalUncalibratedRecHit {

Expand All @@ -21,32 +22,30 @@ class EcalUncalibratedRecHit {

};

EcalUncalibratedRecHit() :
amplitude_(0.), pedestal_(0.), jitter_(0.), chi2_(10000.), OOTamplitude_(0.), OOTchi2_(10000.), flags_(0), aux_(0) { }
EcalUncalibratedRecHit();

EcalUncalibratedRecHit(const DetId& id, float ampl, float ped,
float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0):
amplitude_(ampl), pedestal_(ped), jitter_(jit), chi2_(chi2), OOTamplitude_(0.), OOTchi2_(10000.), flags_(flags), aux_(aux), id_(id) { }
float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0);


float amplitude() const { return amplitude_; }
float amplitudeError() const { return amplitudeError_; }
float pedestal() const { return pedestal_; }
float jitter() const { return jitter_; }
float chi2() const { return chi2_; }
float outOfTimeEnergy() const { return OOTamplitude_; }
float outOfTimeChi2() const { return OOTchi2_; }
float outOfTimeAmplitude(int bx) const { return OOTamplitudes_[bx]; }

uint32_t flags() const { return flags_; }
float jitterError() const;
uint8_t jitterErrorBits() const;
DetId id() const { return id_; }

void setAmplitude( float amplitude ) { amplitude_ = amplitude; }
void setAmplitudeError( float amplitudeerror ) { amplitudeError_ = amplitudeerror; }
void setPedestal( float pedestal ) { pedestal_ = pedestal; }
void setJitter( float jitter ) { jitter_ = jitter; }
void setChi2( float chi2 ) { chi2_ = chi2; }
void setOutOfTimeEnergy( float energy ) { OOTamplitude_ = energy; }
void setOutOfTimeChi2( float chi2 ){ OOTchi2_ = chi2; }
void setOutOfTimeAmplitude( int bx, float amplitude ) { OOTamplitudes_[bx] = amplitude; }

void setJitterError( float jitterErr );
void setFlags( uint32_t flags ) { flags_ = flags; }
Expand All @@ -60,15 +59,16 @@ class EcalUncalibratedRecHit {
bool isJitterErrorValid() const;

private:
float amplitude_; //< Reconstructed amplitude
float pedestal_; //< Reconstructed pedestal
float jitter_; //< Reconstructed time jitter
float chi2_; //< Chi2 of the pulse
float OOTamplitude_; //< Out-Of-Time reconstructed amplitude
float OOTchi2_; //< Out-Of-Time Chi2
uint32_t flags_; //< flag to be propagated to RecHit
uint32_t aux_; //< aux word; first 8 bits contain time (jitter) error
DetId id_; //< Detector ID
float amplitude_; //< Reconstructed amplitude
float amplitudeError_; //< Reconstructed amplitude uncertainty
float pedestal_; //< Reconstructed pedestal
float jitter_; //< Reconstructed time jitter
float chi2_; //< Chi2 of the pulse
float OOTamplitudes_[EcalDataFrame::MAXSAMPLES]; //< Out-Of-Time reconstructed amplitude, one for each active BX, from readout sample 0 to 9
float OOTchi2_; //< Out-Of-Time Chi2
uint32_t flags_; //< flag to be propagated to RecHit
uint32_t aux_; //< aux word; first 8 bits contain time (jitter) error
DetId id_; //< Detector ID
};

#endif
12 changes: 12 additions & 0 deletions DataFormats/EcalRecHit/src/EcalUncalibratedRecHit.cc
Expand Up @@ -3,6 +3,18 @@
#include <cmath>


EcalUncalibratedRecHit::EcalUncalibratedRecHit() :
amplitude_(0.), amplitudeError_(0.), pedestal_(0.), jitter_(0.), chi2_(10000.), flags_(0), aux_(0) {
const unsigned int nsample = EcalDataFrame::MAXSAMPLES;
for(unsigned int ibx=0; ibx<nsample; ++ibx) OOTamplitudes_[ibx] = 0.;
}

EcalUncalibratedRecHit:: EcalUncalibratedRecHit(const DetId& id, float ampl, float ped,
float jit, float chi2, uint32_t flags, uint32_t aux):
amplitude_(ampl), amplitudeError_(0.), pedestal_(ped), jitter_(jit), chi2_(chi2), flags_(flags), aux_(aux), id_(id) {
const unsigned int nsample = EcalDataFrame::MAXSAMPLES;
for(unsigned int ibx=0; ibx<nsample; ++ibx) OOTamplitudes_[ibx] = 0.;
}

bool EcalUncalibratedRecHit::isSaturated() const {
return EcalUncalibratedRecHit::checkFlag(kSaturated);
Expand Down
7 changes: 4 additions & 3 deletions DataFormats/EcalRecHit/src/classes_def.xml
@@ -1,7 +1,7 @@
<lcgdict>
<class name="EcalUncalibratedRecHit" ClassVersion="11">
<class name="EcalUncalibratedRecHit" ClassVersion="12">
<version ClassVersion="12" checksum="343844348"/>
<version ClassVersion="11" checksum="4183938955"/>
<version ClassVersion="10" checksum="2325626302"/>
</class>
<class name="std::vector<EcalUncalibratedRecHit>"/>
<class name="edm::SortedCollection<EcalUncalibratedRecHit,edm::StrictWeakOrdering<EcalUncalibratedRecHit> >"/>
Expand All @@ -10,9 +10,10 @@
<class name="edm::RefVector<edm::SortedCollection<EcalUncalibratedRecHit,edm::StrictWeakOrdering<EcalUncalibratedRecHit> >,EcalUncalibratedRecHit,edm::refhelper::FindUsingAdvance<edm::SortedCollection<EcalUncalibratedRecHit,edm::StrictWeakOrdering<EcalUncalibratedRecHit> >,EcalUncalibratedRecHit> >"/>
<class name="edm::RefProd<edm::SortedCollection<EcalUncalibratedRecHit,edm::StrictWeakOrdering<EcalUncalibratedRecHit> > >"/>

<class name="EcalRecHit" ClassVersion="11">
<class name="EcalRecHit" ClassVersion="12">
<version ClassVersion="10" checksum="283504841"/>
<version ClassVersion="11" checksum="3356791847"/>
<version ClassVersion="12" checksum="3356791847"/>
</class>
<class name="std::vector<EcalRecHit>"/>
<class name="edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> >"/>
Expand Down
10 changes: 5 additions & 5 deletions DataFormats/EcalRecHit/test/testEcalRecHit.cppunit.cc
Expand Up @@ -82,9 +82,9 @@ void testEcalRecHit::testOne() {
CPPUNIT_ASSERT_DOUBLES_EQUAL(timerr*25, rh.timeError(), 0.5);
CPPUNIT_ASSERT_DOUBLES_EQUAL(urh.jitterError()*25, rh.timeError(), 0.00001);

// test outOfTimeEnergy
rh.setOutOfTimeEnergy(1.8);
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.8, rh.outOfTimeEnergy(), 0.01);
rh.setOutOfTimeEnergy(50.8);
CPPUNIT_ASSERT_DOUBLES_EQUAL(50.8, rh.outOfTimeEnergy(), 0.01);
// test energyError
rh.setEnergyError(0.51);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.51, rh.energyError(), 0.01);
rh.setEnergyError(50.8);
CPPUNIT_ASSERT_DOUBLES_EQUAL(50.8, rh.energyError(), 0.01);
}