CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HcalHitReconstructor Class Reference

#include <HcalHitReconstructor.h>

Inheritance diagram for HcalHitReconstructor:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
virtual void endRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
 HcalHitReconstructor (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~HcalHitReconstructor ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef void(HcalSimpleRecAlgo::* SetCorrectionFcn )(boost::shared_ptr< AbsOOTPileupCorrection >)
 

Private Attributes

std::string cat_
 
int cntprtCorrMethod_
 
bool correctTiming_
 
std::string corrName_
 
std::string dataOOTCorrectionCategory_
 
std::string dataOOTCorrectionName_
 
DetId::Detector det_
 
bool digiTimeFromDB_
 
bool dropZSmarkedPassed_
 
bool first_
 
int firstAuxTS_
 
int firstSample_
 
HBHEStatusBitSetterhbheFlagSetter_
 
HBHETimeProfileStatusBitSetterhbheHSCPFlagSetter_
 
HBHENegativeFlagSetterhbheNegativeFlagSetter_
 
HBHEPulseShapeFlagSetterhbhePulseShapeFlagSetter_
 
HBHETimingShapedFlagSetterhbheTimingShapedFlagSetter_
 
HcalHFStatusBitFromDigishfdigibit_
 
std::unique_ptr
< HcalFlagHFDigiTimeParams
HFDigiTimeParams
 
HcalHF_PETalgorithmhfPET_
 
HcalHF_S9S1algorithmhfS8S1_
 
HcalHF_S9S1algorithmhfS9S1_
 
HFTimingTrustFlagHFTimingTrustFlagSetter_
 
edm::InputTag inputLabel_
 
std::string mcOOTCorrectionCategory_
 
std::string mcOOTCorrectionName_
 
HcalRecoParamsparamTS
 
int puCorrMethod_
 
HcalSimpleRecAlgo reco_
 
bool recoParamsFromDB_
 
int samplesToAdd_
 
HcalADCSaturationFlagsaturationFlagSetter_
 
bool setHSCPFlags_
 
bool setNegativeFlags_
 
bool setNoiseFlags_
 
SetCorrectionFcn setPileupCorrection_
 
bool setPulseShapeFlags_
 
bool setSaturationFlags_
 
bool setTimingTrustFlags_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
edm::EDGetTokenT
< HcalCalibDigiCollection
tok_calib_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< HODigiCollection
tok_ho_
 
bool tsFromDB_
 
bool useLeakCorrection_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Author
J. Temple & E. Yazgan Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 46 of file HcalHitReconstructor.h.

Member Typedef Documentation

typedef void(HcalSimpleRecAlgo::* HcalHitReconstructor::SetCorrectionFcn)(boost::shared_ptr< AbsOOTPileupCorrection >)
private

Definition at line 57 of file HcalHitReconstructor.h.

Constructor & Destructor Documentation

HcalHitReconstructor::HcalHitReconstructor ( const edm::ParameterSet ps)
explicit

Definition at line 25 of file HcalHitReconstructor.cc.

References DetId::Calo, dataOOTCorrectionCategory_, dataOOTCorrectionName_, det_, digiTimeFromDB_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), hbheFlagSetter_, hbheHSCPFlagSetter_, hbheNegativeFlagSetter_, hbhePulseShapeFlagSetter_, hbheTimingShapedFlagSetter_, HcalBarrel, HcalCalibration, HcalForward, HcalOther, HcalOuter, hfdigibit_, hfPET_, hfS8S1_, hfS9S1_, HFTimingTrustFlagSetter_, inputLabel_, mcOOTCorrectionCategory_, mcOOTCorrectionName_, puCorrMethod_, reco_, recoParamsFromDB_, saturationFlagSetter_, HcalSimpleRecAlgo::setHBHEPileupCorrection(), setHSCPFlags_, HcalSimpleRecAlgo::setMeth3Params(), setNegativeFlags_, setNoiseFlags_, setPileupCorrection_, HcalSimpleRecAlgo::setpuCorrMethod(), HcalSimpleRecAlgo::setpuCorrParams(), setPulseShapeFlags_, setSaturationFlags_, setTimingTrustFlags_, AlCaHLTBitMon_QueryRunRegistry::string, subdet_, HcalZDCDetId::SubdetectorId, subdetOther_, tok_calib_, tok_hbhe_, tok_hf_, and tok_ho_.

25  :
26  reco_(conf.getParameter<bool>("correctForTimeslew"),
27  conf.getParameter<bool>("correctForPhaseContainment"),
28  conf.getParameter<double>("correctionPhaseNS")),
30  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
31  correctTiming_(conf.getParameter<bool>("correctTiming")),
32  setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
33  setHSCPFlags_(conf.getParameter<bool>("setHSCPFlags")),
34  setSaturationFlags_(conf.getParameter<bool>("setSaturationFlags")),
35  setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
36  setPulseShapeFlags_(conf.getParameter<bool>("setPulseShapeFlags")),
37  setNegativeFlags_(false),
38  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
39  firstAuxTS_(conf.getParameter<int>("firstAuxTS")),
40  firstSample_(conf.getParameter<int>("firstSample")),
41  samplesToAdd_(conf.getParameter<int>("samplesToAdd")),
42  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
43  useLeakCorrection_(conf.getParameter<bool>("useLeakCorrection")),
49  paramTS(0),
50  puCorrMethod_(conf.getParameter<int>("puCorrMethod")),
52  first_(true)
53 
54 {
55  // register for data access
56  tok_hbhe_ = consumes<HBHEDigiCollection>(inputLabel_);
57  tok_ho_ = consumes<HODigiCollection>(inputLabel_);
58  tok_hf_ = consumes<HFDigiCollection>(inputLabel_);
59  tok_calib_ = consumes<HcalCalibDigiCollection>(inputLabel_);
60 
61  std::string subd=conf.getParameter<std::string>("Subdetector");
62  //Set all FlagSetters to 0
63  /* Important to do this! Otherwise, if the setters are turned off,
64  the "if (XSetter_) delete XSetter_;" commands can crash
65  */
66 
67  recoParamsFromDB_ = conf.getParameter<bool>("recoParamsFromDB");
68  // recoParamsFromDB_ = false ; // trun off for now.
69 
70  // std::cout<<" HcalHitReconstructor recoParamsFromDB_ "<<recoParamsFromDB_<<std::endl;
71 
72  if (conf.existsAs<bool>("setNegativeFlags"))
73  setNegativeFlags_ = conf.getParameter<bool>("setNegativeFlags");
74 
75  hbheFlagSetter_ = 0;
80  hfdigibit_ = 0;
81 
82  hfS9S1_ = 0;
83  hfS8S1_ = 0;
84  hfPET_ = 0;
87  digiTimeFromDB_ = false; // only need for HF
88 
90  {
91  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
92  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
93  }
94 
95  if (!strcasecmp(subd.c_str(),"HBHE")) {
97 
100 
101  bool timingShapedCutsFlags = conf.getParameter<bool>("setTimingShapedCutsFlags");
102  if (timingShapedCutsFlags)
103  {
104  const edm::ParameterSet& psTshaped = conf.getParameter<edm::ParameterSet>("timingshapedcutsParameters");
105  hbheTimingShapedFlagSetter_ = new HBHETimingShapedFlagSetter(psTshaped.getParameter<std::vector<double> >("tfilterEnvelope"),
106  psTshaped.getParameter<bool>("ignorelowest"),
107  psTshaped.getParameter<bool>("ignorehighest"),
108  psTshaped.getParameter<double>("win_offset"),
109  psTshaped.getParameter<double>("win_gain"));
110  }
111 
112  if (setNoiseFlags_)
113  {
114  const edm::ParameterSet& psdigi =conf.getParameter<edm::ParameterSet>("flagParameters");
115  hbheFlagSetter_=new HBHEStatusBitSetter(psdigi.getParameter<double>("nominalPedestal"),
116  psdigi.getParameter<double>("hitEnergyMinimum"),
117  psdigi.getParameter<int>("hitMultiplicityThreshold"),
118  psdigi.getParameter<std::vector<edm::ParameterSet> >("pulseShapeParameterSets")
119  );
120  } // if (setNoiseFlags_)
121  if (setHSCPFlags_)
122  {
123  const edm::ParameterSet& psHSCP = conf.getParameter<edm::ParameterSet>("hscpParameters");
125  psHSCP.getParameter<double>("r1Max"),
126  psHSCP.getParameter<double>("r2Min"),
127  psHSCP.getParameter<double>("r2Max"),
128  psHSCP.getParameter<double>("fracLeaderMin"),
129  psHSCP.getParameter<double>("fracLeaderMax"),
130  psHSCP.getParameter<double>("slopeMin"),
131  psHSCP.getParameter<double>("slopeMax"),
132  psHSCP.getParameter<double>("outerMin"),
133  psHSCP.getParameter<double>("outerMax"),
134  psHSCP.getParameter<double>("TimingEnergyThreshold"));
135  } // if (setHSCPFlags_)
137  {
138  const edm::ParameterSet &psPulseShape = conf.getParameter<edm::ParameterSet>("pulseShapeParameters");
140  psPulseShape.getParameter<double>("MinimumChargeThreshold"),
141  psPulseShape.getParameter<double>("TS4TS5ChargeThreshold"),
142  psPulseShape.getParameter<unsigned int>("TrianglePeakTS"),
143  psPulseShape.getParameter<std::vector<double> >("LinearThreshold"),
144  psPulseShape.getParameter<std::vector<double> >("LinearCut"),
145  psPulseShape.getParameter<std::vector<double> >("RMS8MaxThreshold"),
146  psPulseShape.getParameter<std::vector<double> >("RMS8MaxCut"),
147  psPulseShape.getParameter<std::vector<double> >("LeftSlopeThreshold"),
148  psPulseShape.getParameter<std::vector<double> >("LeftSlopeCut"),
149  psPulseShape.getParameter<std::vector<double> >("RightSlopeThreshold"),
150  psPulseShape.getParameter<std::vector<double> >("RightSlopeCut"),
151  psPulseShape.getParameter<std::vector<double> >("RightSlopeSmallThreshold"),
152  psPulseShape.getParameter<std::vector<double> >("RightSlopeSmallCut"),
153  psPulseShape.getParameter<std::vector<double> >("TS4TS5LowerThreshold"),
154  psPulseShape.getParameter<std::vector<double> >("TS4TS5LowerCut"),
155  psPulseShape.getParameter<std::vector<double> >("TS4TS5UpperThreshold"),
156  psPulseShape.getParameter<std::vector<double> >("TS4TS5UpperCut"),
157  psPulseShape.getParameter<bool>("UseDualFit"),
158  psPulseShape.getParameter<bool>("TriangleIgnoreSlow"));
159  } // if (setPulseShapeFlags_)
160  if (setNegativeFlags_)
162 
163  produces<HBHERecHitCollection>();
164  } else if (!strcasecmp(subd.c_str(),"HO")) {
166  // setPileupCorrection_ = &HcalSimpleRecAlgo::setHOPileupCorrection;
168  produces<HORecHitCollection>();
169  } else if (!strcasecmp(subd.c_str(),"HF")) {
171  // setPileupCorrection_ = &HcalSimpleRecAlgo::setHFPileupCorrection;
173  digiTimeFromDB_=conf.getParameter<bool>("digiTimeFromDB");
174 
175  if (setTimingTrustFlags_) {
176 
177  const edm::ParameterSet& pstrust = conf.getParameter<edm::ParameterSet>("hfTimingTrustParameters");
178  HFTimingTrustFlagSetter_=new HFTimingTrustFlag(pstrust.getParameter<int>("hfTimingTrustLevel1"),
179  pstrust.getParameter<int>("hfTimingTrustLevel2"));
180  }
181 
182  if (setNoiseFlags_)
183  {
184  const edm::ParameterSet& psdigi =conf.getParameter<edm::ParameterSet>("digistat");
185  const edm::ParameterSet& psTimeWin =conf.getParameter<edm::ParameterSet>("HFInWindowStat");
186  hfdigibit_=new HcalHFStatusBitFromDigis(psdigi,psTimeWin);
187 
188  const edm::ParameterSet& psS9S1 = conf.getParameter<edm::ParameterSet>("S9S1stat");
189  hfS9S1_ = new HcalHF_S9S1algorithm(psS9S1.getParameter<std::vector<double> >("short_optimumSlope"),
190  psS9S1.getParameter<std::vector<double> >("shortEnergyParams"),
191  psS9S1.getParameter<std::vector<double> >("shortETParams"),
192  psS9S1.getParameter<std::vector<double> >("long_optimumSlope"),
193  psS9S1.getParameter<std::vector<double> >("longEnergyParams"),
194  psS9S1.getParameter<std::vector<double> >("longETParams"),
195  psS9S1.getParameter<int>("HcalAcceptSeverityLevel"),
196  psS9S1.getParameter<bool>("isS8S1")
197  );
198 
199  const edm::ParameterSet& psS8S1 = conf.getParameter<edm::ParameterSet>("S8S1stat");
200  hfS8S1_ = new HcalHF_S9S1algorithm(psS8S1.getParameter<std::vector<double> >("short_optimumSlope"),
201  psS8S1.getParameter<std::vector<double> >("shortEnergyParams"),
202  psS8S1.getParameter<std::vector<double> >("shortETParams"),
203  psS8S1.getParameter<std::vector<double> >("long_optimumSlope"),
204  psS8S1.getParameter<std::vector<double> >("longEnergyParams"),
205  psS8S1.getParameter<std::vector<double> >("longETParams"),
206  psS8S1.getParameter<int>("HcalAcceptSeverityLevel"),
207  psS8S1.getParameter<bool>("isS8S1")
208  );
209 
210  const edm::ParameterSet& psPET = conf.getParameter<edm::ParameterSet>("PETstat");
211  hfPET_ = new HcalHF_PETalgorithm(psPET.getParameter<std::vector<double> >("short_R"),
212  psPET.getParameter<std::vector<double> >("shortEnergyParams"),
213  psPET.getParameter<std::vector<double> >("shortETParams"),
214  psPET.getParameter<std::vector<double> >("long_R"),
215  psPET.getParameter<std::vector<double> >("longEnergyParams"),
216  psPET.getParameter<std::vector<double> >("longETParams"),
217  psPET.getParameter<int>("HcalAcceptSeverityLevel"),
218  psPET.getParameter<std::vector<double> >("short_R_29"),
219  psPET.getParameter<std::vector<double> >("long_R_29")
220  );
221  }
222  produces<HFRecHitCollection>();
223  } else if (!strcasecmp(subd.c_str(),"ZDC")) {
226  produces<ZDCRecHitCollection>();
227  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
230  produces<HcalCalibRecHitCollection>();
231  } else {
232  edm::LogWarning("Configuration") << "HcalHitReconstructor is not associated with a specific subdetector!" << std::endl;
233  }
234 
235  // If no valid OOT pileup correction name specified,
236  // disable the correction
237  if (conf.existsAs<std::string>("dataOOTCorrectionName"))
238  dataOOTCorrectionName_ = conf.getParameter<std::string>("dataOOTCorrectionName");
239  if (conf.existsAs<std::string>("dataOOTCorrectionCategory"))
240  dataOOTCorrectionCategory_ = conf.getParameter<std::string>("dataOOTCorrectionCategory");
241  if (conf.existsAs<std::string>("mcOOTCorrectionName"))
242  mcOOTCorrectionName_ = conf.getParameter<std::string>("mcOOTCorrectionName");
243  if (conf.existsAs<std::string>("mcOOTCorrectionCategory"))
244  mcOOTCorrectionCategory_ = conf.getParameter<std::string>("mcOOTCorrectionCategory");
245  if (dataOOTCorrectionName_.empty() && mcOOTCorrectionName_.empty())
247 
249  if(puCorrMethod_ == 2) {
251  conf.getParameter<bool> ("applyPedConstraint"),
252  conf.getParameter<bool> ("applyTimeConstraint"),
253  conf.getParameter<bool> ("applyPulseJitter"),
254  conf.getParameter<bool> ("applyUnconstrainedFit"),
255  conf.getParameter<bool> ("applyTimeSlew"),
256  conf.getParameter<double>("ts4Min"),
257  conf.getParameter<double>("ts4Max"),
258  conf.getParameter<double>("pulseJitter"),
259  conf.getParameter<double>("meanTime"),
260  conf.getParameter<double>("timeSigma"),
261  conf.getParameter<double>("meanPed"),
262  conf.getParameter<double>("pedSigma"),
263  conf.getParameter<double>("noise"),
264  conf.getParameter<double>("timeMin"),
265  conf.getParameter<double>("timeMax"),
266  conf.getParameter<double>("ts3chi2"),
267  conf.getParameter<double>("ts4chi2"),
268  conf.getParameter<double>("ts345chi2"),
269  conf.getParameter<double>("chargeMax"), //For the unconstrained Fit
270  conf.getParameter<int> ("fitTimes")
271  );
272  }
274  conf.getParameter<int> ("pedestalSubtractionType"),
275  conf.getParameter<double> ("pedestalUpperLimit"),
276  conf.getParameter<int> ("timeSlewParsType"),
277  conf.getParameter<std::vector<double> >("timeSlewPars"),
278  conf.getParameter<double> ("respCorrM3")
279  );
280 }
void setMeth3Params(int iPedSubMethod, float iPedSubThreshold, int iTimeSlewParsType, std::vector< double > iTimeSlewPars, double irespCorrM3)
T getParameter(std::string const &) const
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
HcalADCSaturationFlag * saturationFlagSetter_
SetCorrectionFcn setPileupCorrection_
std::string dataOOTCorrectionCategory_
HBHENegativeFlagSetter * hbheNegativeFlagSetter_
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
HcalHFStatusBitFromDigis * hfdigibit_
edm::EDGetTokenT< HODigiCollection > tok_ho_
tuple conf
Definition: dbtoconf.py:185
HcalHF_PETalgorithm * hfPET_
HcalHF_S9S1algorithm * hfS9S1_
HBHEPulseShapeFlagSetter * hbhePulseShapeFlagSetter_
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
void setHBHEPileupCorrection(boost::shared_ptr< AbsOOTPileupCorrection > corr)
HBHEStatusBitSetter * hbheFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
void setpuCorrMethod(int method)
HcalHF_S9S1algorithm * hfS8S1_
HcalOtherSubdetector subdetOther_
HFTimingTrustFlag * HFTimingTrustFlagSetter_
std::string mcOOTCorrectionCategory_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalSimpleRecAlgo reco_
void setpuCorrParams(bool iPedestalConstraint, bool iTimeConstraint, bool iAddPulseJitter, bool iUnConstrainedFit, bool iApplyTimeSlew, double iTS4Min, double iTS4Max, double iPulseJitter, double iTimeMean, double iTimeSig, double iPedMean, double iPedSig, double iNoise, double iTMin, double iTMax, double its3Chi2, double its4Chi2, double its345Chi2, double iChargeThreshold, int iFitTimes)
HcalHitReconstructor::~HcalHitReconstructor ( )
virtual

Definition at line 295 of file HcalHitReconstructor.cc.

References hbheFlagSetter_, hbheHSCPFlagSetter_, hbheNegativeFlagSetter_, hbhePulseShapeFlagSetter_, hbheTimingShapedFlagSetter_, hfdigibit_, hfPET_, hfS8S1_, hfS9S1_, HFTimingTrustFlagSetter_, paramTS, and saturationFlagSetter_.

295  {
296  delete hbheFlagSetter_;
297  delete hbheHSCPFlagSetter_;
301  delete hfdigibit_;
302 
303  delete hfS9S1_;
304  delete hfS8S1_;
305  delete hfPET_;
306  delete saturationFlagSetter_;
308 
309  delete paramTS;
310 }
HcalADCSaturationFlag * saturationFlagSetter_
HBHENegativeFlagSetter * hbheNegativeFlagSetter_
HcalHFStatusBitFromDigis * hfdigibit_
HcalHF_PETalgorithm * hfPET_
HcalHF_S9S1algorithm * hfS9S1_
HBHEPulseShapeFlagSetter * hbhePulseShapeFlagSetter_
HBHEStatusBitSetter * hbheFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
HcalHF_S9S1algorithm * hfS8S1_
HFTimingTrustFlag * HFTimingTrustFlagSetter_

Member Function Documentation

void HcalHitReconstructor::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
finaloverridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 312 of file HcalHitReconstructor.cc.

References HcalSimpleRecAlgo::beginRun(), digiTimeFromDB_, edm::EventSetup::get(), HFDigiTimeParams, AlCaHLTBitMon_ParallelJobs::p, paramTS, edm::ESHandle< class >::product(), reco_, recoParamsFromDB_, HcalCondObjectContainerBase::setTopo(), and tsFromDB_.

312  {
313 
315  es.get<HcalRecNumberingRecord>().get(htopo);
316 
317  if ( tsFromDB_== true || recoParamsFromDB_ == true )
318  {
320  es.get<HcalRecoParamsRcd>().get(p);
321  paramTS = new HcalRecoParams(*p.product());
322  paramTS->setTopo(htopo.product());
323 
324 
325 
326 
327  // std::cout<<" skdump in HcalHitReconstructor::beginRun dupm RecoParams "<<std::endl;
328  // std::ofstream skfile("skdumpRecoParamsNewFormat.txt");
329  // HcalDbASCIIIO::dumpObject(skfile, (*paramTS) );
330  }
331 
332  if (digiTimeFromDB_==true)
333  {
335  es.get<HcalFlagHFDigiTimeParamsRcd>().get(p);
336  HFDigiTimeParams.reset( new HcalFlagHFDigiTimeParams( *p ) );
337 
339  es.get<HcalRecNumberingRecord>().get(htopo);
340  HFDigiTimeParams->setTopo(htopo.product());
341 
342  }
343 
344  reco_.beginRun(es);
345 }
void beginRun(edm::EventSetup const &es)
std::unique_ptr< HcalFlagHFDigiTimeParams > HFDigiTimeParams
T const * product() const
Definition: ESHandle.h:86
void setTopo(const HcalTopology *topo)
HcalSimpleRecAlgo reco_
void HcalHitReconstructor::endRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
finaloverridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 347 of file HcalHitReconstructor.cc.

References digiTimeFromDB_, HcalSimpleRecAlgo::endRun(), paramTS, reco_, and tsFromDB_.

347  {
348  if (tsFromDB_==true)
349  {
350  delete paramTS; paramTS=0;
351  }
352  if (digiTimeFromDB_==true)
353  {
354  //DL delete HFDigiTimeParams; HFDigiTimeParams = 0;
355  }
356  reco_.endRun();
357 }
HcalSimpleRecAlgo reco_
void HcalHitReconstructor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 284 of file HcalHitReconstructor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and edm::ParameterSetDescription::setAllowAnything().

284  {
286  desc.setAllowAnything();
287  desc.add<int>("pedestalSubtractionType", 1);
288  desc.add<double>("pedestalUpperLimit", 2.7);
289  desc.add<int>("timeSlewParsType",3);
290  desc.add<std::vector<double>>("timeSlewPars", { 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 });
291  desc.add<double>("respCorrM3", 0.95);
292  descriptions.add("hltHbhereco",desc);
293 }
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HcalHitReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 359 of file HcalHitReconstructor.cc.

References funct::abs(), cat_, HBHEStatusBitSetter::Clear(), cntprtCorrMethod_, HBHENegativeFlagSetter::configFilter(), HcalTimingCorrector::Correct(), HcalRecoParam::correctForPhaseContainment(), castor_dqm_sourceclient-live_cfg::correctForPhaseContainment, HcalRecoParam::correctForTimeslew(), castor_dqm_sourceclient-live_cfg::correctForTimeslew, HcalRecoParam::correctionPhaseNS(), HcalRecoParam::correctTiming(), correctTiming_, corrName_, dataOOTCorrectionCategory_, dataOOTCorrectionName_, HLT_25ns14e33_v1_cff::depth, det_, digiTimeFromDB_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, HBHETimeProfileStatusBitSetter::EnergyThreshold(), edm::EventSetup::find(), plotBeamSpotDB::first, first_, HcalRecoParam::firstAuxTS(), firstAuxTS_, HcalRecoParam::firstSample(), firstSample_, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), edm::Event::getByToken(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), hbheFlagSetter_, hbheHSCPFlagSetter_, hbheNegativeFlagSetter_, hbhePulseShapeFlagSetter_, HBHETimeProfileStatusBitSetter::hbheSetTimeFlagsFromDigi(), hbheTimingShapedFlagSetter_, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, hfdigibit_, HcalFlagHFDigiTimeParam::HFdigiflagCoefficients(), HcalFlagHFDigiTimeParam::HFdigiflagExpectedPeak(), HcalFlagHFDigiTimeParam::HFdigiflagFirstSample(), HcalFlagHFDigiTimeParam::HFdigiflagMinEThreshold(), HcalFlagHFDigiTimeParam::HFdigiflagSamplesToAdd(), HFDigiTimeParams, hfPET_, hfS8S1_, hfS9S1_, HcalHFStatusBitFromDigis::hfSetFlagFromDigi(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), HFTimingTrustFlagSetter_, i, edm::EventBase::isRealData(), j, relval_steps::k, LogTrace, mcOOTCorrectionCategory_, mcOOTCorrectionName_, AlCaHLTBitMon_ParallelJobs::p, paramTS, HcalRecoParam::pileupCleaningID(), HcalCaloFlagLabels::PresampleADC, edm::ESHandle< class >::product(), puCorrMethod_, edm::Event::put(), DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstruct(), recoParamsFromDB_, HcalHFStatusBitFromDigis::resetParamsFromDB(), edm::Event::run(), HcalRecoParam::samplesToAdd(), samplesToAdd_, saturationFlagSetter_, HBHEStatusBitSetter::SetFlagsFromDigi(), HBHEStatusBitSetter::SetFlagsFromRecHits(), HcalSimpleRecAlgo::setForData(), HFTimingTrustFlag::setHFTimingTrustFlag(), setHSCPFlags_, HcalSimpleRecAlgo::setLeakCorrection(), setNegativeFlags_, setNoiseFlags_, setPileupCorrection_, HBHENegativeFlagSetter::setPulseShapeFlags(), HBHEPulseShapeFlagSetter::SetPulseShapeFlags(), setPulseShapeFlags_, HcalSimpleRecAlgo::setRecoParams(), HcalADCSaturationFlag::setSaturationFlag(), setSaturationFlags_, HBHETimingShapedFlagSetter::SetTimingShapedFlags(), setTimingTrustFlags_, subdet_, subdetOther_, tok_calib_, tok_hbhe_, tok_hf_, tok_ho_, tsFromDB_, HcalRecoParam::useLeakCorrection(), and useLeakCorrection_.

360 {
361 
362  // get conditions
364  eventSetup.get<HcalRecNumberingRecord>().get(topo);
365 
366  edm::ESHandle<HcalDbService> conditions;
367  eventSetup.get<HcalDbRecord>().get(conditions);
368 
369  // HACK related to HB- corrections
370  if ( first_ ) {
371  const bool isData = e.isRealData();
372  if (isData) reco_.setForData(e.run()); else reco_.setForData(0);
375  first_=false;
376  }
378 
380  eventSetup.get<HcalChannelQualityRcd>().get("withTopo",p);
381  const HcalChannelQuality* myqual = p.product();
382 
384  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
385  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
386 
387  // Configure OOT pileup corrections
388  bool isMethod1Set = false;
389  if (!corrName_.empty())
390  {
391  edm::ESHandle<OOTPileupCorrectionColl> pileupCorrections;
392  if (eventSetup.find(edm::eventsetup::EventSetupRecordKey::makeKey<HcalOOTPileupCorrectionRcd>()))
393  eventSetup.get<HcalOOTPileupCorrectionRcd>().get(pileupCorrections);
394  else
395  eventSetup.get<HcalOOTPileupCompatibilityRcd>().get(pileupCorrections);
396 
397  if( setPileupCorrection_ ){
398  const OOTPileupCorrData * testMethod1Ptr = dynamic_cast<OOTPileupCorrData*>((pileupCorrections->get(corrName_, cat_)).get());
399  if( testMethod1Ptr ) isMethod1Set = true;
400  (reco_.*setPileupCorrection_)(pileupCorrections->get(corrName_, cat_));
401  }
402  }
403 
404  // Configure the negative energy filter
407  {
408  eventSetup.get<HBHENegativeEFilterRcd>().get(negEhandle);
410  }
411 
412  // Only for HBHE
413  if( subdet_ == HcalBarrel ) {
414  if( !cntprtCorrMethod_ ) {
416  if( puCorrMethod_ == 2 ) LogTrace("HcalPUcorrMethod") << "Using Hcal OOTPU method 2" << std::endl;
417  else if( puCorrMethod_ == 1 ){
418  if( isMethod1Set ) LogTrace("HcalPUcorrMethod") << "Using Hcal OOTPU method 1" << std::endl;
419  else edm::LogWarning("HcalPUcorrMethod") <<"puCorrMethod_ set to be 1 but method 1 is NOT activated (method 0 used instead)!\n"
420  <<"Please check GlobalTag usage or method 1 separately disabled by dataOOTCorrectionName & mcOOTCorrectionName?" << std::endl;
421  } else if (puCorrMethod_ == 3) {
422  LogTrace("HcalPUcorrMethod") << "Using Hcal Deterministic Fit Method!" << std::endl;
423  } else LogTrace("HcalPUcorrMethod") << "Using Hcal OOTPU method 0" << std::endl;
424  }
425  }
426 
427  // GET THE BEAM CROSSING INFO HERE, WHEN WE UNDERSTAND HOW THINGS WORK.
428  // Then, call "setBXInfo" method of the reco_ object.
429  // Also remember to call SetBXInfo in the negative energy flag setter.
430 
431  if (det_==DetId::Hcal) {
432 
433  // HBHE -------------------------------------------------------------------
436 
437  e.getByToken(tok_hbhe_,digi);
438 
439  // create empty output
440  std::auto_ptr<HBHERecHitCollection> rec(new HBHERecHitCollection);
441  rec->reserve(digi->size());
442  // run the algorithm
445  std::vector<HBHEDataFrame> HBDigis;
446  std::vector<int> RecHitIndex;
447 
448  // Vote on majority TS0 CapId
449  int favorite_capid = 0;
450  if (correctTiming_) {
451  long capid_votes[4] = {0,0,0,0};
452  for (i=digi->begin(); i!=digi->end(); i++) {
453  capid_votes[(*i)[0].capid()]++;
454  }
455  for (int k = 0; k < 4; k++)
456  if (capid_votes[k] > capid_votes[favorite_capid])
457  favorite_capid = k;
458  }
459 
460  for (i=digi->begin(); i!=digi->end(); i++) {
461  HcalDetId cell = i->id();
462  DetId detcell=(DetId)cell;
463 
465  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
466  if(tsFromDB_) {
467  firstSample_ = param_ts->firstSample();
468  samplesToAdd_ = param_ts->samplesToAdd();
469  }
470  if(recoParamsFromDB_) {
471  bool correctForTimeslew=param_ts->correctForTimeslew();
473  float phaseNS=param_ts->correctionPhaseNS();
475  correctTiming_ = param_ts->correctTiming();
476  firstAuxTS_ = param_ts->firstAuxTS();
477  int pileupCleaningID = param_ts->pileupCleaningID();
478 
479  /*
480  int sub = cell.subdet();
481  int depth = cell.depth();
482  int inteta = cell.ieta();
483  int intphi = cell.iphi();
484 
485  std::cout << "HcalHitReconstructor::produce cell:"
486  << " sub, ieta, iphi, depth = "
487  << sub << " " << inteta << " " << intphi
488  << " " << depth << std::endl
489  << " first, toadd = " << firstSample_ << ", "
490  << samplesToAdd_ << std::endl
491  << " correctForTimeslew " << correctForTimeslew
492  << std::endl
493  << " correctForPhaseContainment "
494  << correctForPhaseContainment << std::endl
495  << " phaseNS " << phaseNS << std::endl
496  << " useLeakCorrection " << useLeakCorrection_
497  << std::endl
498  << " correctTiming " << correctTiming_ << std::endl
499  << " firstAuxTS " << firstAuxTS_ << std::endl
500  << " pileupCleaningID " << pileupCleaningID
501  << std::endl;
502  */
503 
504  reco_.setRecoParams(correctForTimeslew,correctForPhaseContainment,useLeakCorrection_,pileupCleaningID,phaseNS);
505  }
506  }
507 
508  int first = firstSample_;
509  int toadd = samplesToAdd_;
510 
511  // check on cells to be ignored and dropped: (rof,20.Feb.09)
512  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
513  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
515  if (i->zsMarkAndPass()) continue;
516 
517  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
518  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
519  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
520  HcalCoderDb coder (*channelCoder, *shape);
521 
522  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
523 
524  // Fill first auxiliary word
525  unsigned int auxflag=0;
526  int fTS = firstAuxTS_;
527  if (fTS<0) fTS=0; // silly protection against time slice <0
528  for (int xx=fTS; xx<fTS+4 && xx<i->size();++xx) {
529  int adcv = i->sample(xx).adc();
530  auxflag+=((adcv&0x7F)<<(7*(xx-fTS))); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
531  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
532  }
533  auxflag+=((i->sample(fTS).capid())<<28);
534  (rec->back()).setAux(auxflag);
535 
536  // Fill second auxiliary word
537  auxflag=0;
538  int fTS2 = (firstAuxTS_-4 < 0) ? 0 : firstAuxTS_-4;
539  for (int xx = fTS2; xx < fTS2+4 && xx<i->size(); ++xx) {
540  int adcv = i->sample(xx).adc();
541  auxflag+=((adcv&0x7F)<<(7*(xx-fTS2)));
542  }
543  auxflag+=((i->sample(fTS2).capid())<<28);
544  (rec->back()).setAuxHBHE(auxflag);
545 
546  (rec->back()).setFlags(0); // this sets all flag bits to 0
547  // Set presample flag
548  if (fTS>0)
549  (rec->back()).setFlagField((i->sample(fTS-1).adc()), HcalCaloFlagLabels::PresampleADC,7);
550 
553  if (setNoiseFlags_)
554  hbheFlagSetter_->SetFlagsFromDigi(&(*topo),rec->back(),*i,coder,calibrations,first,toadd);
556  hbhePulseShapeFlagSetter_->SetPulseShapeFlags(rec->back(), *i, coder, calibrations);
557  if (setNegativeFlags_)
558  hbheNegativeFlagSetter_->setPulseShapeFlags(rec->back(), *i, coder, calibrations);
561  if (correctTiming_)
562  HcalTimingCorrector::Correct(rec->back(), *i, favorite_capid);
563  if (setHSCPFlags_ && i->id().ietaAbs()<16)
564  {
565  double DigiEnergy=0;
566  for(int j=0; j!=i->size(); DigiEnergy += i->sample(j++).nominal_fC());
567  if(DigiEnergy > hbheHSCPFlagSetter_->EnergyThreshold())
568  {
569  HBDigis.push_back(*i);
570  RecHitIndex.push_back(rec->size()-1);
571  }
572 
573  } // if (set HSCPFlags_ && |ieta|<16)
574  } // loop over HBHE digis
575 
576 
578  if (setHSCPFlags_) hbheHSCPFlagSetter_->hbheSetTimeFlagsFromDigi(rec.get(), HBDigis, RecHitIndex);
579  // return result
580  e.put(rec);
581 
582  // HO ------------------------------------------------------------------
583  } else if (subdet_==HcalOuter) {
585  e.getByToken(tok_ho_,digi);
586 
587  // create empty output
588  std::auto_ptr<HORecHitCollection> rec(new HORecHitCollection);
589  rec->reserve(digi->size());
590  // run the algorithm
592 
593  // Vote on majority TS0 CapId
594  int favorite_capid = 0;
595  if (correctTiming_) {
596  long capid_votes[4] = {0,0,0,0};
597  for (i=digi->begin(); i!=digi->end(); i++) {
598  capid_votes[(*i)[0].capid()]++;
599  }
600  for (int k = 0; k < 4; k++)
601  if (capid_votes[k] > capid_votes[favorite_capid])
602  favorite_capid = k;
603  }
604 
605  for (i=digi->begin(); i!=digi->end(); i++) {
606  HcalDetId cell = i->id();
607  DetId detcell=(DetId)cell;
608  // firstSample & samplesToAdd
610  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
611  if(tsFromDB_) {
612  firstSample_ = param_ts->firstSample();
613  samplesToAdd_ = param_ts->samplesToAdd();
614  }
615  if(recoParamsFromDB_) {
616  bool correctForTimeslew=param_ts->correctForTimeslew();
617  bool correctForPhaseContainment= param_ts->correctForPhaseContainment();
618  float phaseNS=param_ts->correctionPhaseNS();
620  correctTiming_ = param_ts->correctTiming();
621  firstAuxTS_ = param_ts->firstAuxTS();
622  int pileupCleaningID = param_ts->pileupCleaningID();
623  reco_.setRecoParams(correctForTimeslew,correctForPhaseContainment,useLeakCorrection_,pileupCleaningID,phaseNS);
624  }
625  }
626 
627  int first = firstSample_;
628  int toadd = samplesToAdd_;
629 
630  // check on cells to be ignored and dropped: (rof,20.Feb.09)
631  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
632  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
634  if (i->zsMarkAndPass()) continue;
635 
636  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
637  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
638  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
639  HcalCoderDb coder (*channelCoder, *shape);
640 
641  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
642 
643  // Set auxiliary flag
644  int auxflag=0;
645  int fTS = firstAuxTS_;
646  if (fTS<0) fTS=0; //silly protection against negative time slice values
647  for (int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
648  auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
649  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
650  auxflag+=((i->sample(fTS).capid())<<28);
651  (rec->back()).setAux(auxflag);
652  (rec->back()).setFlags(0);
653  // Fill Presample ADC flag
654  if (fTS>0)
655  (rec->back()).setFlagField((i->sample(fTS-1).adc()), HcalCaloFlagLabels::PresampleADC,7);
656 
659  if (correctTiming_)
660  HcalTimingCorrector::Correct(rec->back(), *i, favorite_capid);
661  }
662  // return result
663  e.put(rec);
664 
665  // HF -------------------------------------------------------------------
666  } else if (subdet_==HcalForward) {
668  e.getByToken(tok_hf_,digi);
669 
670 
672  // create empty output
673  std::auto_ptr<HFRecHitCollection> rec(new HFRecHitCollection);
674  rec->reserve(digi->size());
675  // run the algorithm
677 
678  // Vote on majority TS0 CapId
679  int favorite_capid = 0;
680  if (correctTiming_) {
681  long capid_votes[4] = {0,0,0,0};
682  for (i=digi->begin(); i!=digi->end(); i++) {
683  capid_votes[(*i)[0].capid()]++;
684  }
685  for (int k = 0; k < 4; k++)
686  if (capid_votes[k] > capid_votes[favorite_capid])
687  favorite_capid = k;
688  }
689 
690  for (i=digi->begin(); i!=digi->end(); i++) {
691  HcalDetId cell = i->id();
692  DetId detcell=(DetId)cell;
693 
695  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
696  if(tsFromDB_) {
697  firstSample_ = param_ts->firstSample();
698  samplesToAdd_ = param_ts->samplesToAdd();
699  }
700  if(recoParamsFromDB_) {
701  bool correctForTimeslew=param_ts->correctForTimeslew();
702  bool correctForPhaseContainment= param_ts->correctForPhaseContainment();
703  float phaseNS=param_ts->correctionPhaseNS();
705  correctTiming_ = param_ts->correctTiming();
706  firstAuxTS_ = param_ts->firstAuxTS();
707  int pileupCleaningID = param_ts->pileupCleaningID();
708  reco_.setRecoParams(correctForTimeslew,correctForPhaseContainment,useLeakCorrection_,pileupCleaningID,phaseNS);
709  }
710  }
711 
712  int first = firstSample_;
713  int toadd = samplesToAdd_;
714 
715  // check on cells to be ignored and dropped: (rof,20.Feb.09)
716  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
717  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
719  if (i->zsMarkAndPass()) continue;
720 
721  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
722  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
723  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
724  HcalCoderDb coder (*channelCoder, *shape);
725 
726  // Set HFDigiTime flag values from digiTimeFromDB_
727  if (digiTimeFromDB_==true && hfdigibit_!=0)
728  {
729  const HcalFlagHFDigiTimeParam* hfDTparam = HFDigiTimeParams->getValues(detcell.rawId());
731  hfDTparam->HFdigiflagSamplesToAdd(),
732  hfDTparam->HFdigiflagExpectedPeak(),
733  hfDTparam->HFdigiflagMinEThreshold(),
734  hfDTparam->HFdigiflagCoefficients()
735  );
736  }
737 
738  //std::cout << "TOADDHF " << toadd << " " << first << " " << std::endl;
739  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
740 
741  // Set auxiliary flag
742  int auxflag=0;
743  int fTS = firstAuxTS_;
744  if (fTS<0) fTS=0; // silly protection against negative time slice values
745  for (int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
746  auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
747  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
748  auxflag+=((i->sample(fTS).capid())<<28);
749  (rec->back()).setAux(auxflag);
750 
751  // Clear flags
752  (rec->back()).setFlags(0);
753 
754  // Fill Presample ADC flag
755  if (fTS>0)
756  (rec->back()).setFlagField((i->sample(fTS-1).adc()), HcalCaloFlagLabels::PresampleADC,7);
757 
758  // This calls the code for setting the HF noise bit determined from digi shape
759  if (setNoiseFlags_)
760  hfdigibit_->hfSetFlagFromDigi(rec->back(),*i,coder,calibrations);
765  if (correctTiming_)
766  HcalTimingCorrector::Correct(rec->back(), *i, favorite_capid);
767  } // for (i=digi->begin(); i!=digi->end(); i++) -- loop on all HF digis
768 
769  // The following flags require the full set of rechits
770  // These need to be set consecutively, so an energy check should be the first
771  // test performed on these hits (to minimize the loop time)
772  if (setNoiseFlags_)
773  {
774  // Step 1: Set PET flag (short fibers of |ieta|==29)
775  // Neighbor/partner channels that are flagged by Pulse Shape algorithm (HFDigiTime)
776  // won't be considered in these calculations
777  for (HFRecHitCollection::iterator i = rec->begin();i!=rec->end();++i)
778  {
779  int depth=i->id().depth();
780  int ieta=i->id().ieta();
781  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
782  if (depth==2 || abs(ieta)==29 )
783  hfPET_->HFSetFlagFromPET(*i,*rec,myqual,mySeverity);
784  }
785 
786  // Step 2: Set S8S1 flag (short fibers or |ieta|==29)
787  for (HFRecHitCollection::iterator i = rec->begin();i!=rec->end();++i)
788  {
789  int depth=i->id().depth();
790  int ieta=i->id().ieta();
791  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
792  if (depth==2 || abs(ieta)==29 )
793  hfS8S1_->HFSetFlagFromS9S1(*i,*rec,myqual,mySeverity);
794  }
795 
796  // Set 3: Set S9S1 flag (long fibers)
797  for (HFRecHitCollection::iterator i = rec->begin();i!=rec->end();++i)
798  {
799  int depth=i->id().depth();
800  int ieta=i->id().ieta();
801  // Short fibers and all channels at |ieta|=29 use PET settings in Algo 3
802  if (depth==1 && abs(ieta)!=29 )
803  hfS9S1_->HFSetFlagFromS9S1(*i,*rec,myqual, mySeverity);
804  }
805  }
806 
807  // return result
808  e.put(rec);
809  } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) {
811  e.getByToken(tok_calib_,digi);
812 
813  // create empty output
814  std::auto_ptr<HcalCalibRecHitCollection> rec(new HcalCalibRecHitCollection);
815  rec->reserve(digi->size());
816  // run the algorithm
817  int first = firstSample_;
818  int toadd = samplesToAdd_;
819 
821  for (i=digi->begin(); i!=digi->end(); i++) {
822  HcalCalibDetId cell = i->id();
823  // HcalDetId cellh = i->id();
824  DetId detcell=(DetId)cell;
825  // check on cells to be ignored and dropped: (rof,20.Feb.09)
826  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
827  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
829  if (i->zsMarkAndPass()) continue;
830 
831  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
832  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
833  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
834  HcalCoderDb coder (*channelCoder, *shape);
835 
836  // firstSample & samplesToAdd
837  if(tsFromDB_) {
838  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
839  first = param_ts->firstSample();
840  toadd = param_ts->samplesToAdd();
841  }
842  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
843 
844  /*
845  // Flag setting not available for calibration rechits
846  // Set auxiliary flag
847  int auxflag=0;
848  int fTS = firstAuxTS_;
849  for (int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
850  auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS)); // store the time slices in the first 28 bits of aux, a set of 4 7-bit adc values
851  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
852  auxflag+=((i->sample(fTS).capid())<<28);
853  (rec->back()).setAux(auxflag);
854 
855  (rec->back()).setFlags(0); // Not yet implemented for HcalCalibRecHit
856  */
857  }
858  // return result
859  e.put(rec);
860  }
861  }
862  //DL delete myqual;
863 } // void HcalHitReconstructor::produce(...)
unsigned int firstSample() const
Definition: HcalRecoParam.h:32
int i
Definition: DBlmapReader.cc:9
void HFSetFlagFromS9S1(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
HBHERecHit reconstruct(const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
void configFilter(const HBHENegativeEFilter *f)
void setHFTimingTrustFlag(HFRecHit &rechit, const HFDataFrame &digi)
unsigned int pileupCleaningID() const
Definition: HcalRecoParam.h:44
HcalADCSaturationFlag * saturationFlagSetter_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
uint32_t HFdigiflagSamplesToAdd() const
bool correctForPhaseContainment() const
Definition: HcalRecoParam.h:29
void hfSetFlagFromDigi(HFRecHit &hf, const HFDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
std::vector< HBHEDataFrame >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
void resetParamsFromDB(int firstSample, int samplesToAdd, int expectedPeak, double minthreshold, const std::vector< double > &coef)
bool isRealData() const
Definition: EventBase.h:64
SetCorrectionFcn setPileupCorrection_
void HFSetFlagFromPET(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::string dataOOTCorrectionCategory_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
HBHENegativeFlagSetter * hbheNegativeFlagSetter_
std::unique_ptr< HcalFlagHFDigiTimeParams > HFDigiTimeParams
void get(HolderT &iHolder) const
bool correctForTimeslew() const
Definition: HcalRecoParam.h:38
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
bool correctTiming() const
Definition: HcalRecoParam.h:40
RunNumber_t run() const
Definition: Event.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalHFStatusBitFromDigis * hfdigibit_
int j
Definition: DBlmapReader.cc:9
bool dropChannel(const uint32_t &mystatus) const
uint32_t HFdigiflagExpectedPeak() const
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector< HBHEDataFrame > &, const std::vector< int > &)
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:33
edm::EDGetTokenT< HODigiCollection > tok_ho_
#define LogTrace(id)
float correctionPhaseNS() const
Definition: HcalRecoParam.h:31
std::vector< HFRecHit >::iterator iterator
std::vector< double > HFdigiflagCoefficients() const
HcalHF_PETalgorithm * hfPET_
Definition: DetId.h:18
HcalHF_S9S1algorithm * hfS9S1_
HBHEPulseShapeFlagSetter * hbhePulseShapeFlagSetter_
void setRecoParams(bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
void SetTimingShapedFlags(HBHERecHit &hbhe)
uint32_t HFdigiflagFirstSample() const
void setForData(int runnum)
T const * product() const
Definition: ESHandle.h:86
HBHEStatusBitSetter * hbheFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
void setPulseShapeFlags(HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
HcalHF_S9S1algorithm * hfS8S1_
void SetFlagsFromRecHits(const HcalTopology *topo, HBHERecHitCollection &rec)
HcalOtherSubdetector subdetOther_
static void Correct(HBHERecHit &rechit, const HBHEDataFrame &digi, int favorite_capid)
void SetPulseShapeFlags(HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
unsigned int firstAuxTS() const
Definition: HcalRecoParam.h:41
HFTimingTrustFlag * HFTimingTrustFlagSetter_
uint32_t getValue() const
void SetFlagsFromDigi(const HcalTopology *topo, HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib, int firstSample=3, int samplesToAdd=4)
std::string mcOOTCorrectionCategory_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalSimpleRecAlgo reco_
double HFdigiflagMinEThreshold() const
bool useLeakCorrection() const
Definition: HcalRecoParam.h:36

Member Data Documentation

std::string HcalHitReconstructor::cat_
private

Definition at line 116 of file HcalHitReconstructor.h.

Referenced by produce().

int HcalHitReconstructor::cntprtCorrMethod_
private

Definition at line 114 of file HcalHitReconstructor.h.

Referenced by produce().

bool HcalHitReconstructor::correctTiming_
private

Definition at line 81 of file HcalHitReconstructor.h.

Referenced by produce().

std::string HcalHitReconstructor::corrName_
private

Definition at line 116 of file HcalHitReconstructor.h.

Referenced by produce().

std::string HcalHitReconstructor::dataOOTCorrectionCategory_
private

Definition at line 105 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

std::string HcalHitReconstructor::dataOOTCorrectionName_
private

Definition at line 104 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

DetId::Detector HcalHitReconstructor::det_
private

Definition at line 72 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::digiTimeFromDB_
private

Definition at line 97 of file HcalHitReconstructor.h.

Referenced by beginRun(), endRun(), HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::dropZSmarkedPassed_
private

Definition at line 88 of file HcalHitReconstructor.h.

Referenced by produce().

bool HcalHitReconstructor::first_
private

Definition at line 115 of file HcalHitReconstructor.h.

Referenced by produce().

int HcalHitReconstructor::firstAuxTS_
private

Definition at line 90 of file HcalHitReconstructor.h.

Referenced by produce().

int HcalHitReconstructor::firstSample_
private

Definition at line 93 of file HcalHitReconstructor.h.

Referenced by produce().

HBHEStatusBitSetter* HcalHitReconstructor::hbheFlagSetter_
private

Definition at line 62 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HBHETimeProfileStatusBitSetter* HcalHitReconstructor::hbheHSCPFlagSetter_
private

Definition at line 63 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HBHENegativeFlagSetter* HcalHitReconstructor::hbheNegativeFlagSetter_
private

Definition at line 66 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HBHEPulseShapeFlagSetter* HcalHitReconstructor::hbhePulseShapeFlagSetter_
private

Definition at line 65 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HBHETimingShapedFlagSetter* HcalHitReconstructor::hbheTimingShapedFlagSetter_
private

Definition at line 64 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HcalHFStatusBitFromDigis* HcalHitReconstructor::hfdigibit_
private

Definition at line 67 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

std::unique_ptr<HcalFlagHFDigiTimeParams> HcalHitReconstructor::HFDigiTimeParams
private

Definition at line 111 of file HcalHitReconstructor.h.

Referenced by beginRun(), and produce().

HcalHF_PETalgorithm* HcalHitReconstructor::hfPET_
private

Definition at line 70 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HcalHF_S9S1algorithm* HcalHitReconstructor::hfS8S1_
private

Definition at line 69 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HcalHF_S9S1algorithm* HcalHitReconstructor::hfS9S1_
private

Definition at line 68 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

HFTimingTrustFlag* HcalHitReconstructor::HFTimingTrustFlagSetter_
private

Definition at line 61 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

edm::InputTag HcalHitReconstructor::inputLabel_
private

Definition at line 75 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor().

std::string HcalHitReconstructor::mcOOTCorrectionCategory_
private

Definition at line 107 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

std::string HcalHitReconstructor::mcOOTCorrectionName_
private

Definition at line 106 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

HcalRecoParams* HcalHitReconstructor::paramTS
private

Definition at line 110 of file HcalHitReconstructor.h.

Referenced by beginRun(), endRun(), produce(), and ~HcalHitReconstructor().

int HcalHitReconstructor::puCorrMethod_
private

Definition at line 113 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

HcalSimpleRecAlgo HcalHitReconstructor::reco_
private

Definition at line 59 of file HcalHitReconstructor.h.

Referenced by beginRun(), endRun(), HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::recoParamsFromDB_
private

Definition at line 96 of file HcalHitReconstructor.h.

Referenced by beginRun(), HcalHitReconstructor(), and produce().

int HcalHitReconstructor::samplesToAdd_
private

Definition at line 94 of file HcalHitReconstructor.h.

Referenced by produce().

HcalADCSaturationFlag* HcalHitReconstructor::saturationFlagSetter_
private

Definition at line 60 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), produce(), and ~HcalHitReconstructor().

bool HcalHitReconstructor::setHSCPFlags_
private

Definition at line 83 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::setNegativeFlags_
private

Definition at line 87 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::setNoiseFlags_
private

Definition at line 82 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

SetCorrectionFcn HcalHitReconstructor::setPileupCorrection_
private

Definition at line 108 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::setPulseShapeFlags_
private

Definition at line 86 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::setSaturationFlags_
private

Definition at line 84 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::setTimingTrustFlags_
private

Definition at line 85 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

int HcalHitReconstructor::subdet_
private

Definition at line 73 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

HcalOtherSubdetector HcalHitReconstructor::subdetOther_
private

Definition at line 74 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

edm::EDGetTokenT<HcalCalibDigiCollection> HcalHitReconstructor::tok_calib_
private

Definition at line 79 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

edm::EDGetTokenT<HBHEDigiCollection> HcalHitReconstructor::tok_hbhe_
private

Definition at line 76 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

edm::EDGetTokenT<HFDigiCollection> HcalHitReconstructor::tok_hf_
private

Definition at line 78 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

edm::EDGetTokenT<HODigiCollection> HcalHitReconstructor::tok_ho_
private

Definition at line 77 of file HcalHitReconstructor.h.

Referenced by HcalHitReconstructor(), and produce().

bool HcalHitReconstructor::tsFromDB_
private

Definition at line 95 of file HcalHitReconstructor.h.

Referenced by beginRun(), endRun(), and produce().

bool HcalHitReconstructor::useLeakCorrection_
private

Definition at line 101 of file HcalHitReconstructor.h.

Referenced by produce().