CMS 3D CMS Logo

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

#include <OOTPileupCorrData.h>

Inheritance diagram for OOTPileupCorrData:
AbsOOTPileupCorrection

Public Member Functions

void apply (const HcalDetId &id, const double *inputCharge, unsigned lenInputCharge, const BunchXParameter *bcParams, unsigned lenBcParams, unsigned firstTimeSlice, unsigned nTimeSlices, double *correctedCharge, unsigned lenCorrectedCharge, bool *pulseShapeCorrApplied, bool *leakCorrApplied, bool *readjustTiming) const
 
void apply (const HcalDetId &id, double *ts, const int tsTrig) const
 
bool inputIsEnergy () const
 
 OOTPileupCorrData (const std::vector< OOTPileupCorrDataFcn > &corrs, const std::vector< uint32_t > &iEtaLimits, double chargeLimit, int requireFirstTS, int requireNTS, bool readjustTiming)
 
 OOTPileupCorrData ()
 
virtual ~OOTPileupCorrData ()
 
- Public Member Functions inherited from AbsOOTPileupCorrection
bool operator!= (const AbsOOTPileupCorrection &r) const
 
bool operator== (const AbsOOTPileupCorrection &r) const
 
virtual ~AbsOOTPileupCorrection ()
 

Protected Member Functions

bool isEqual (const AbsOOTPileupCorrection &otherBase) const
 

Private Member Functions

template<class Archive >
void load (Archive &ar, const unsigned)
 
template<class Archive >
void save (Archive &ar, const unsigned) const
 
bool validate () const
 

Private Attributes

double chargeLimit_
 
std::vector< OOTPileupCorrDataFcncorrs_
 
std::vector< uint32_t > iEtaLimits_
 
uint8_t readjustTiming_
 
int32_t requireFirstTS_
 
int32_t requireNTS_
 

Friends

class boost::serialization::access
 

Detailed Description

Definition at line 14 of file OOTPileupCorrData.h.

Constructor & Destructor Documentation

OOTPileupCorrData::OOTPileupCorrData ( const std::vector< OOTPileupCorrDataFcn > &  corrs,
const std::vector< uint32_t > &  iEtaLimits,
double  chargeLimit,
int  requireFirstTS,
int  requireNTS,
bool  readjustTiming 
)

Definition at line 7 of file OOTPileupCorrData.cc.

References edm::hlt::Exception, and validate().

14  : corrs_(corrs),
15  iEtaLimits_(iEtaLimits),
16  chargeLimit_(chargeLimit),
17  requireFirstTS_(requireFirstTS),
18  requireNTS_(requireNTS),
19  readjustTiming_(readjustTiming)
20 {
21  if (!validate()) throw cms::Exception(
22  "Invalid OOTPileupCorrData constructor arguments");
23 }
std::vector< uint32_t > iEtaLimits_
bool validate() const
std::vector< OOTPileupCorrDataFcn > corrs_
virtual OOTPileupCorrData::~OOTPileupCorrData ( )
inlinevirtual

Definition at line 57 of file OOTPileupCorrData.h.

57 {}
OOTPileupCorrData::OOTPileupCorrData ( )
inline

Definition at line 107 of file OOTPileupCorrData.h.

107 {}

Member Function Documentation

void OOTPileupCorrData::apply ( const HcalDetId id,
const double *  inputCharge,
unsigned  lenInputCharge,
const BunchXParameter *  bcParams,
unsigned  lenBcParams,
unsigned  firstTimeSlice,
unsigned  nTimeSlices,
double *  correctedCharge,
unsigned  lenCorrectedCharge,
bool *  pulseShapeCorrApplied,
bool *  leakCorrApplied,
bool *  readjustTiming 
) const
virtual

Implements AbsOOTPileupCorrection.

Definition at line 40 of file OOTPileupCorrData.cc.

References edm::hlt::Exception, i, readjustTiming_, requireFirstTS_, and requireNTS_.

Referenced by heavyIonTools.ConfigureHeavyIons::__call__(), editorTools.UserCodeTool::__call__(), HiCoreTools.RestrictInputToAOD::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), heavyIonTools.ProductionDefaults::__call__(), editorTools.ChangeSource::__call__(), HiCoreTools.RemoveMCMatching::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), jetTools.AddJetCollection::__call__(), trigTools.SwitchOnTrigger::__call__(), heavyIonTools.SelectionDefaults::__call__(), HiCoreTools.RemoveAllPATObjectsBut::__call__(), heavyIonTools.DisbaleMonteCarloDeps::__call__(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties::__call__(), HiCoreTools.RemoveSpecificPATObjects::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), trackTools.MakeTrackCandidates::__call__(), runMVAMEtUncertainties.RunMVAMEtUncertainties::__call__(), tauTools.AddTauCollection::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), HiCoreTools.RemoveCleaning::__call__(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties::__call__(), HiCoreTools.AddCleaning::__call__(), runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.AddJetID::__call__(), and jetTools.SetTagInfos::__call__().

47 {
48  // Check the arguments
49  if (inputCharge == 0 || correctedCharge == 0 ||
50  lenCorrectedCharge < lenInputCharge ||
51  pulseShapeCorrApplied == 0 || leakCorrApplied == 0 ||
52  readjustTiming == 0)
53  throw cms::Exception(
54  "Invalid arguments in OOTPileupCorrData::apply");
55 
56  for (unsigned i=0; i<lenInputCharge; ++i)
57  correctedCharge[i] = inputCharge[i];
58 
59  // Check whether the charge corrections should actually be applied
60  const bool fixCharge = (requireFirstTS_ < 0 ||
61  requireFirstTS_ == static_cast<int32_t>(firstTimeSlice)) &&
62  (requireNTS_ < 0 ||
63  requireNTS_ == static_cast<int32_t>(nTimeSlices));
64  if (fixCharge)
65  apply(id, correctedCharge, firstTimeSlice);
66 
67  *pulseShapeCorrApplied = false;
68  *leakCorrApplied = fixCharge;
69  *readjustTiming = readjustTiming_;
70 }
int i
Definition: DBlmapReader.cc:9
void apply(const HcalDetId &id, const double *inputCharge, unsigned lenInputCharge, const BunchXParameter *bcParams, unsigned lenBcParams, unsigned firstTimeSlice, unsigned nTimeSlices, double *correctedCharge, unsigned lenCorrectedCharge, bool *pulseShapeCorrApplied, bool *leakCorrApplied, bool *readjustTiming) const
void OOTPileupCorrData::apply ( const HcalDetId id,
double *  ts,
const int  tsTrig 
) const
inline

Definition at line 72 of file OOTPileupCorrData.h.

References funct::abs(), chargeLimit_, corrs_, and iEtaLimits_.

Referenced by heavyIonTools.ConfigureHeavyIons::__call__(), editorTools.UserCodeTool::__call__(), HiCoreTools.RestrictInputToAOD::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), heavyIonTools.ProductionDefaults::__call__(), editorTools.ChangeSource::__call__(), HiCoreTools.RemoveMCMatching::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), jetTools.AddJetCollection::__call__(), trigTools.SwitchOnTrigger::__call__(), heavyIonTools.SelectionDefaults::__call__(), HiCoreTools.RemoveAllPATObjectsBut::__call__(), heavyIonTools.DisbaleMonteCarloDeps::__call__(), runType1CaloMEtUncertainties.RunType1CaloMEtUncertainties::__call__(), HiCoreTools.RemoveSpecificPATObjects::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), trackTools.MakeTrackCandidates::__call__(), runMVAMEtUncertainties.RunMVAMEtUncertainties::__call__(), tauTools.AddTauCollection::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), HiCoreTools.RemoveCleaning::__call__(), runType1PFMEtUncertainties.RunType1PFMEtUncertainties::__call__(), HiCoreTools.AddCleaning::__call__(), runNoPileUpMEtUncertainties.RunNoPileUpMEtUncertainties::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.AddJetID::__call__(), and jetTools.SetTagInfos::__call__().

73  {
74  if (ts[tsTrig] > chargeLimit_)
75  {
76  const unsigned nLimits(iEtaLimits_.size());
77  if (nLimits)
78  {
79  const uint32_t uEta = std::abs(id.ieta());
80  const uint32_t* limits(&iEtaLimits_[0]);
81  unsigned which(0U);
82  for (; which<nLimits; ++which)
83  if (uEta < limits[which])
84  break;
85  corrs_[which].pucorrection(ts, tsTrig);
86  }
87  }
88  }
std::vector< uint32_t > iEtaLimits_
std::vector< OOTPileupCorrDataFcn > corrs_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool OOTPileupCorrData::inputIsEnergy ( ) const
inlinevirtual

Implements AbsOOTPileupCorrection.

Definition at line 69 of file OOTPileupCorrData.h.

69 {return false;}
bool OOTPileupCorrData::isEqual ( const AbsOOTPileupCorrection otherBase) const
inlineprotectedvirtual

Implements AbsOOTPileupCorrection.

Definition at line 92 of file OOTPileupCorrData.h.

References chargeLimit_, corrs_, iEtaLimits_, alignCSCRings::r, readjustTiming_, requireFirstTS_, and requireNTS_.

93  {
94  const OOTPileupCorrData& r =
95  static_cast<const OOTPileupCorrData&>(otherBase);
96  return corrs_ == r.corrs_ &&
97  iEtaLimits_ == r.iEtaLimits_ &&
100  requireNTS_ == r.requireNTS_ &&
102  }
std::vector< uint32_t > iEtaLimits_
std::vector< OOTPileupCorrDataFcn > corrs_
template<class Archive >
void OOTPileupCorrData::load ( Archive &  ar,
const unsigned   
)
inlineprivate

Definition at line 132 of file OOTPileupCorrData.h.

References chargeLimit_, corrs_, edm::hlt::Exception, iEtaLimits_, readjustTiming_, requireFirstTS_, requireNTS_, and validate().

Referenced by MatrixToProcess.MatrixToProcess::getProcess(), and MatrixToProcess.MatrixToProcess::listAll().

133  {
134  boost::serialization::base_object<AbsOOTPileupCorrection>(*this);
137  if (!validate()) throw cms::Exception(
138  "In OOTPileupCorrData::load: invalid data");
139  }
std::vector< uint32_t > iEtaLimits_
bool validate() const
std::vector< OOTPileupCorrDataFcn > corrs_
template<class Archive >
void OOTPileupCorrData::save ( Archive &  ar,
const unsigned   
) const
inlineprivate

Definition at line 122 of file OOTPileupCorrData.h.

References chargeLimit_, corrs_, edm::hlt::Exception, iEtaLimits_, readjustTiming_, requireFirstTS_, requireNTS_, and validate().

Referenced by Vispa.Main.TabController.TabController::allowClose(), and Vispa.Main.TabController.TabController::checkModificationTimestamp().

123  {
124  if (!validate()) throw cms::Exception(
125  "In OOTPileupCorrData::save: invalid data");
126  boost::serialization::base_object<AbsOOTPileupCorrection>(*this);
129  }
std::vector< uint32_t > iEtaLimits_
bool validate() const
std::vector< OOTPileupCorrDataFcn > corrs_
bool OOTPileupCorrData::validate ( ) const
private

Definition at line 25 of file OOTPileupCorrData.cc.

References corrs_, i, and iEtaLimits_.

Referenced by load(), OOTPileupCorrData(), and save().

26 {
27  const std::size_t nLimits(iEtaLimits_.size());
28  if (!nLimits)
29  return false;
30  if (nLimits >= static_cast<std::size_t>(UINT_MAX))
31  return false;
32  for (std::size_t i=0; i<nLimits-1; ++i)
33  if (!(iEtaLimits_[i] < iEtaLimits_[i+1]))
34  return false;
35  if (corrs_.size() != nLimits + 1)
36  return false;
37  return true;
38 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint32_t > iEtaLimits_
std::vector< OOTPileupCorrDataFcn > corrs_

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 119 of file OOTPileupCorrData.h.

Member Data Documentation

double OOTPileupCorrData::chargeLimit_
private

Definition at line 114 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), and save().

std::vector<OOTPileupCorrDataFcn> OOTPileupCorrData::corrs_
private

Definition at line 112 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), save(), and validate().

std::vector<uint32_t> OOTPileupCorrData::iEtaLimits_
private

Definition at line 113 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), save(), and validate().

uint8_t OOTPileupCorrData::readjustTiming_
private

Definition at line 117 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), and save().

int32_t OOTPileupCorrData::requireFirstTS_
private

Definition at line 115 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), and save().

int32_t OOTPileupCorrData::requireNTS_
private

Definition at line 116 of file OOTPileupCorrData.h.

Referenced by apply(), isEqual(), load(), and save().