CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HiEvtPlaneFlatProducer Class Reference
Inheritance diagram for HiEvtPlaneFlatProducer:
edm::stream::EDProducer<>

Public Member Functions

 HiEvtPlaneFlatProducer (const edm::ParameterSet &)
 
 ~HiEvtPlaneFlatProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double caloCentRef_
 
double caloCentRefWidth_
 
int CentBinCompression_
 
edm::InputTag centralityBinTag_
 
edm::EDGetTokenT< int > centralityBinToken
 
std::string centralityLabel_
 
std::string centralityMC_
 
edm::InputTag centralityTag_
 
edm::EDGetTokenT< reco::CentralitycentralityToken
 
std::string centralityVariable_
 
HiEvtPlaneFlattenflat [hi::NumEPNames]
 
const int FlatOrder_
 
edm::ESWatcher< HeavyIonRPRcdhirpWatcher
 
edm::ESWatcher< HeavyIonRcdhiWatcher
 
edm::InputTag inputPlanesTag_
 
edm::EDGetTokenT< reco::EvtPlaneCollectioninputPlanesToken
 
int Noffmax_
 
int Noffmin_
 
int NumFlatBins_
 
edm::Handle< reco::TrackCollectiontrackCollection_
 
edm::InputTag trackTag_
 
edm::EDGetTokenT< reco::TrackCollectiontrackToken
 
bool useOffsetPsi_
 
edm::InputTag vertexTag_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 48 of file HiEvtPlaneFlatProducer.cc.

Constructor & Destructor Documentation

◆ HiEvtPlaneFlatProducer()

HiEvtPlaneFlatProducer::HiEvtPlaneFlatProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 92 of file HiEvtPlaneFlatProducer.cc.

93  : centralityVariable_(iConfig.getParameter<std::string>("centralityVariable")),
94  centralityBinTag_(iConfig.getParameter<edm::InputTag>("centralityBinTag")),
95  centralityTag_(iConfig.getParameter<edm::InputTag>("centralityTag")),
96  vertexTag_(iConfig.getParameter<edm::InputTag>("vertexTag")),
97  inputPlanesTag_(iConfig.getParameter<edm::InputTag>("inputPlanesTag")),
98  trackTag_(iConfig.getParameter<edm::InputTag>("trackTag")),
99  FlatOrder_(iConfig.getParameter<int>("FlatOrder")),
100  NumFlatBins_(iConfig.getParameter<int>("NumFlatBins")),
101  caloCentRef_(iConfig.getParameter<double>("caloCentRef")),
102  caloCentRefWidth_(iConfig.getParameter<double>("caloCentRefWidth")),
103  CentBinCompression_(iConfig.getParameter<int>("CentBinCompression")),
104  Noffmin_(iConfig.getParameter<int>("Noffmin")),
105  Noffmax_(iConfig.getParameter<int>("Noffmax")),
106  useOffsetPsi_(iConfig.getParameter<bool>("useOffsetPsi")) {
107  if (iConfig.exists("nonDefaultGlauberModel")) {
108  centralityMC_ = iConfig.getParameter<std::string>("nonDefaultGlauberModel");
109  }
111 
112  centralityBinToken = consumes<int>(centralityBinTag_);
113 
114  centralityToken = consumes<reco::Centrality>(centralityTag_);
115 
116  vertexToken = consumes<std::vector<reco::Vertex>>(vertexTag_);
117 
118  trackToken = consumes<reco::TrackCollection>(trackTag_);
119 
120  inputPlanesToken = consumes<reco::EvtPlaneCollection>(inputPlanesTag_);
121 
122  //register your products
123  produces<reco::EvtPlaneCollection>();
124  //now do what ever other initialization is needed
125  for (int i = 0; i < hi::NumEPNames; i++) {
126  flat[i] = new HiEvtPlaneFlatten();
128  }
129 }

References centralityBinTag_, centralityBinToken, centralityLabel_, centralityMC_, centralityTag_, centralityToken, centralityVariable_, hi::EPNames, hi::EPOrder, edm::ParameterSet::exists(), flat, FlatOrder_, edm::ParameterSet::getParameter(), mps_fire::i, HiEvtPlaneFlatten::init(), inputPlanesTag_, inputPlanesToken, hi::NumEPNames, NumFlatBins_, AlCaHLTBitMon_QueryRunRegistry::string, trackTag_, trackToken, vertexTag_, and vertexToken.

◆ ~HiEvtPlaneFlatProducer()

HiEvtPlaneFlatProducer::~HiEvtPlaneFlatProducer ( )
override

Definition at line 131 of file HiEvtPlaneFlatProducer.cc.

131  {
132  // do anything here that needs to be done at desctruction time
133  // (e.g. close files, deallocate resources etc.)
134  for (int i = 0; i < hi::NumEPNames; i++) {
135  delete flat[i];
136  }
137 }

References flat, mps_fire::i, and hi::NumEPNames.

Member Function Documentation

◆ produce()

void HiEvtPlaneFlatProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 140 of file HiEvtPlaneFlatProducer.cc.

140  {
141  using namespace edm;
142  using namespace std;
143  using namespace reco;
144  using namespace hi;
145 
146  //
147  //Get Flattening Parameters
148  //
149  if (hiWatcher.check(iSetup)) {
150  //
151  //Get Size of Centrality Table
152  //
154  iSetup.get<HeavyIonRcd>().get(centralityLabel_, centDB_);
155  int nCentBins = centDB_->m_table.size();
156  for (int i = 0; i < hi::NumEPNames; i++) {
157  flat[i]->setCaloCentRefBins(-1, -1);
158  if (caloCentRef_ > 0) {
159  int minbin = (caloCentRef_ - caloCentRefWidth_ / 2.) * nCentBins / 100.;
160  int maxbin = (caloCentRef_ + caloCentRefWidth_ / 2.) * nCentBins / 100.;
161  minbin /= CentBinCompression_;
162  maxbin /= CentBinCompression_;
163  if (minbin > 0 && maxbin >= minbin) {
164  if (EPDet[i] == HF || EPDet[i] == Castor)
165  flat[i]->setCaloCentRefBins(minbin, maxbin);
166  }
167  }
168  }
169  }
170 
171  if (hirpWatcher.check(iSetup)) {
172  edm::ESHandle<RPFlatParams> flatparmsDB_;
173  iSetup.get<HeavyIonRPRcd>().get(flatparmsDB_);
174  LoadEPDB db(flatparmsDB_, flat);
175  if (!db.IsSuccess())
176  return;
177  }
178  //
179  //Get Centrality
180  //
181 
183 
184  if (Noffmin_ >= 0) {
185  int nOff = iEvent.get(centralityToken).Ntracks();
186  if ((nOff < Noffmin_) or (nOff >= Noffmax_)) {
187  return;
188  }
189  }
190  //
191  //Get Vertex
192  //
193  int vs_sell; // vertex collection size
194  float vzr_sell;
195  auto const& vertices3 = iEvent.get(vertexToken);
196  vs_sell = vertices3.size();
197  if (vs_sell > 0) {
198  vzr_sell = vertices3.begin()->z();
199  } else
200  vzr_sell = -999.9;
201 
202  //
203  //Get Event Planes
204  //
205 
206  auto evtplaneOutput = std::make_unique<EvtPlaneCollection>();
208  for (int i = 0; i < hi::NumEPNames; i++) {
209  ep[i] = nullptr;
210  }
211  int indx = 0;
212  for (auto const& rp : iEvent.get(inputPlanesToken)) {
213  double psiOffset = rp.angle(0);
214  double s = rp.sumSin(0);
215  double c = rp.sumCos(0);
216  uint m = rp.mult();
217 
218  double soff = s;
219  double coff = c;
220  if (useOffsetPsi_) {
221  soff = flat[indx]->getSoffset(s, vzr_sell, bin);
222  coff = flat[indx]->getCoffset(c, vzr_sell, bin);
223  psiOffset = flat[indx]->getOffsetPsi(soff, coff);
224  }
225  double psiFlat = flat[indx]->getFlatPsi(psiOffset, vzr_sell, bin);
226  ep[indx] = new EvtPlane(indx, 2, psiFlat, soff, coff, rp.sumw(), rp.sumw2(), rp.sumPtOrEt(), rp.sumPtOrEt2(), m);
227  ep[indx]->addLevel(0, rp.angle(0), s, c);
228  ep[indx]->addLevel(3, 0., rp.sumSin(3), rp.sumCos(3));
229  if (useOffsetPsi_)
230  ep[indx]->addLevel(1, psiOffset, soff, coff);
231  ++indx;
232  }
233 
234  for (int i = 0; i < hi::NumEPNames; i++) {
235  if (ep[i] != nullptr)
236  evtplaneOutput->push_back(*ep[i]);
237  }
238  iEvent.put(std::move(evtplaneOutput));
239  for (int i = 0; i < indx; i++)
240  delete ep[i];
241 }

References newFWLiteAna::bin, HltBtagPostValidation_cff::c, caloCentRef_, caloCentRefWidth_, CentBinCompression_, centralityBinToken, centralityLabel_, centralityToken, edm::ESWatcher< T >::check(), dqmiodatasetharvest::db, SiStripBadComponentsDQMServiceTemplate_cfg::ep, hi::EPDet, flat, edm::EventSetup::get(), get, HiEvtPlaneFlatten::getCoffset(), HiEvtPlaneFlatten::getFlatPsi(), HiEvtPlaneFlatten::getOffsetPsi(), HiEvtPlaneFlatten::getSoffset(), CaloTPGTranscoder_cfi::HF, hirpWatcher, hiWatcher, mps_fire::i, iEvent, inputPlanesToken, visualization-live-secondInstance_cfg::m, CentralityTable::m_table, eostools::move(), Noffmax_, Noffmin_, hi::NumEPNames, or, alignCSCRings::s, HiEvtPlaneFlatten::setCaloCentRefBins(), parallelization::uint, useOffsetPsi_, and vertexToken.

Member Data Documentation

◆ caloCentRef_

double HiEvtPlaneFlatProducer::caloCentRef_
private

Definition at line 83 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ caloCentRefWidth_

double HiEvtPlaneFlatProducer::caloCentRefWidth_
private

Definition at line 84 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ CentBinCompression_

int HiEvtPlaneFlatProducer::CentBinCompression_
private

Definition at line 85 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ centralityBinTag_

edm::InputTag HiEvtPlaneFlatProducer::centralityBinTag_
private

Definition at line 62 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ centralityBinToken

edm::EDGetTokenT<int> HiEvtPlaneFlatProducer::centralityBinToken
private

Definition at line 63 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer(), and produce().

◆ centralityLabel_

std::string HiEvtPlaneFlatProducer::centralityLabel_
private

Definition at line 59 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer(), and produce().

◆ centralityMC_

std::string HiEvtPlaneFlatProducer::centralityMC_
private

Definition at line 60 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ centralityTag_

edm::InputTag HiEvtPlaneFlatProducer::centralityTag_
private

Definition at line 65 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ centralityToken

edm::EDGetTokenT<reco::Centrality> HiEvtPlaneFlatProducer::centralityToken
private

Definition at line 66 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer(), and produce().

◆ centralityVariable_

std::string HiEvtPlaneFlatProducer::centralityVariable_
private

Definition at line 58 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ flat

HiEvtPlaneFlatten* HiEvtPlaneFlatProducer::flat[hi::NumEPNames]
private

◆ FlatOrder_

const int HiEvtPlaneFlatProducer::FlatOrder_
private

Definition at line 81 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ hirpWatcher

edm::ESWatcher<HeavyIonRPRcd> HiEvtPlaneFlatProducer::hirpWatcher
private

Definition at line 79 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ hiWatcher

edm::ESWatcher<HeavyIonRcd> HiEvtPlaneFlatProducer::hiWatcher
private

Definition at line 78 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ inputPlanesTag_

edm::InputTag HiEvtPlaneFlatProducer::inputPlanesTag_
private

Definition at line 71 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ inputPlanesToken

edm::EDGetTokenT<reco::EvtPlaneCollection> HiEvtPlaneFlatProducer::inputPlanesToken
private

Definition at line 72 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer(), and produce().

◆ Noffmax_

int HiEvtPlaneFlatProducer::Noffmax_
private

Definition at line 87 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ Noffmin_

int HiEvtPlaneFlatProducer::Noffmin_
private

Definition at line 86 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ NumFlatBins_

int HiEvtPlaneFlatProducer::NumFlatBins_
private

Definition at line 82 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ trackCollection_

edm::Handle<reco::TrackCollection> HiEvtPlaneFlatProducer::trackCollection_
private

Definition at line 76 of file HiEvtPlaneFlatProducer.cc.

◆ trackTag_

edm::InputTag HiEvtPlaneFlatProducer::trackTag_
private

Definition at line 74 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ trackToken

edm::EDGetTokenT<reco::TrackCollection> HiEvtPlaneFlatProducer::trackToken
private

Definition at line 75 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ useOffsetPsi_

bool HiEvtPlaneFlatProducer::useOffsetPsi_
private

Definition at line 89 of file HiEvtPlaneFlatProducer.cc.

Referenced by produce().

◆ vertexTag_

edm::InputTag HiEvtPlaneFlatProducer::vertexTag_
private

Definition at line 68 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer().

◆ vertexToken

edm::EDGetTokenT<std::vector<reco::Vertex> > HiEvtPlaneFlatProducer::vertexToken
private

Definition at line 69 of file HiEvtPlaneFlatProducer.cc.

Referenced by HiEvtPlaneFlatProducer(), and produce().

HiEvtPlaneFlatProducer::centralityTag_
edm::InputTag centralityTag_
Definition: HiEvtPlaneFlatProducer.cc:65
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
mps_fire.i
i
Definition: mps_fire.py:355
HiEvtPlaneFlatProducer::Noffmin_
int Noffmin_
Definition: HiEvtPlaneFlatProducer.cc:86
HiEvtPlaneFlatten::setCaloCentRefBins
void setCaloCentRefBins(const int caloCentRefMinBin, const int caloCentRefMaxBin)
Definition: HiEvtPlaneFlatten.h:128
hi::EPNames
const std::string EPNames[]
Definition: HiEvtPlaneList.h:73
HiEvtPlaneFlatProducer::caloCentRefWidth_
double caloCentRefWidth_
Definition: HiEvtPlaneFlatProducer.cc:84
HiEvtPlaneFlatProducer::centralityLabel_
std::string centralityLabel_
Definition: HiEvtPlaneFlatProducer.cc:59
edm
HLT enums.
Definition: AlignableModifier.h:19
HiEvtPlaneFlatten
Definition: HiEvtPlaneFlatten.h:27
LoadEPDB
Definition: LoadEPDB.h:30
HeavyIonRPRcd
Definition: HeavyIonRPRcd.h:24
hi::EPDet
const int EPDet[]
Definition: HiEvtPlaneList.h:81
HiEvtPlaneFlatProducer::centralityBinToken
edm::EDGetTokenT< int > centralityBinToken
Definition: HiEvtPlaneFlatProducer.cc:63
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
parallelization.uint
uint
Definition: parallelization.py:124
HiEvtPlaneFlatten::getOffsetPsi
double getOffsetPsi(double s, double c) const
Definition: HiEvtPlaneFlatten.h:191
hi::EPOrder
const int EPOrder[]
Definition: HiEvtPlaneList.h:85
HiEvtPlaneFlatProducer::trackToken
edm::EDGetTokenT< reco::TrackCollection > trackToken
Definition: HiEvtPlaneFlatProducer.cc:75
dqmiodatasetharvest.db
db
Definition: dqmiodatasetharvest.py:119
HiEvtPlaneFlatten::getFlatPsi
double getFlatPsi(double psi, double vtx, int centbin) const
Definition: HiEvtPlaneFlatten.h:161
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HiEvtPlaneFlatProducer::NumFlatBins_
int NumFlatBins_
Definition: HiEvtPlaneFlatProducer.cc:82
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HiEvtPlaneFlatProducer::hirpWatcher
edm::ESWatcher< HeavyIonRPRcd > hirpWatcher
Definition: HiEvtPlaneFlatProducer.cc:79
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
HiEvtPlaneFlatProducer::centralityToken
edm::EDGetTokenT< reco::Centrality > centralityToken
Definition: HiEvtPlaneFlatProducer.cc:66
HiEvtPlaneFlatProducer::centralityVariable_
std::string centralityVariable_
Definition: HiEvtPlaneFlatProducer.cc:58
CentralityTable::m_table
std::vector< CBin > m_table
Definition: CentralityTable.h:39
edm::ESHandle< CentralityTable >
HiEvtPlaneFlatten::getCoffset
double getCoffset(double c, double vtx, int centbin) const
Definition: HiEvtPlaneFlatten.h:183
HiEvtPlaneFlatProducer::FlatOrder_
const int FlatOrder_
Definition: HiEvtPlaneFlatProducer.cc:81
HiEvtPlaneFlatProducer::inputPlanesToken
edm::EDGetTokenT< reco::EvtPlaneCollection > inputPlanesToken
Definition: HiEvtPlaneFlatProducer.cc:72
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Castor
HiEvtPlaneFlatProducer::centralityBinTag_
edm::InputTag centralityBinTag_
Definition: HiEvtPlaneFlatProducer.cc:62
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
HiEvtPlaneFlatProducer::hiWatcher
edm::ESWatcher< HeavyIonRcd > hiWatcher
Definition: HiEvtPlaneFlatProducer.cc:78
HiEvtPlaneFlatProducer::flat
HiEvtPlaneFlatten * flat[hi::NumEPNames]
Definition: HiEvtPlaneFlatProducer.cc:88
HiEvtPlaneFlatProducer::Noffmax_
int Noffmax_
Definition: HiEvtPlaneFlatProducer.cc:87
reco::EvtPlane
Definition: EvtPlane.h:20
HiEvtPlaneFlatten::getSoffset
double getSoffset(double s, double vtx, int centbin) const
Definition: HiEvtPlaneFlatten.h:175
iEvent
int iEvent
Definition: GenABIO.cc:224
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
HiEvtPlaneFlatProducer::trackTag_
edm::InputTag trackTag_
Definition: HiEvtPlaneFlatProducer.cc:74
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
hi
Definition: HiEvtPlaneList.h:38
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
HiEvtPlaneFlatProducer::CentBinCompression_
int CentBinCompression_
Definition: HiEvtPlaneFlatProducer.cc:85
CaloTPGTranscoder_cfi.HF
HF
Definition: CaloTPGTranscoder_cfi.py:4
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
HiEvtPlaneFlatProducer::inputPlanesTag_
edm::InputTag inputPlanesTag_
Definition: HiEvtPlaneFlatProducer.cc:71
HiEvtPlaneFlatProducer::caloCentRef_
double caloCentRef_
Definition: HiEvtPlaneFlatProducer.cc:83
HiEvtPlaneFlatProducer::useOffsetPsi_
bool useOffsetPsi_
Definition: HiEvtPlaneFlatProducer.cc:89
HiEvtPlaneFlatten::init
void init(int order, int nbins, std::string tag, int vord)
Definition: HiEvtPlaneFlatten.h:35
hi::NumEPNames
static const int NumEPNames
Definition: HiEvtPlaneList.h:126
HeavyIonRcd
Definition: HeavyIonRcd.h:24
HiEvtPlaneFlatProducer::vertexToken
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken
Definition: HiEvtPlaneFlatProducer.cc:69
HiEvtPlaneFlatProducer::vertexTag_
edm::InputTag vertexTag_
Definition: HiEvtPlaneFlatProducer.cc:68
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::InputTag
Definition: InputTag.h:15
HiEvtPlaneFlatProducer::centralityMC_
std::string centralityMC_
Definition: HiEvtPlaneFlatProducer.cc:60