CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CalibratedDigis Class Reference

#include <L1Trigger/DTTriggerPhase2/plugins/CalibratedDigis.cc>

Inheritance diagram for CalibratedDigis:
edm::stream::EDProducer<>

Public Member Functions

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

Private Member Functions

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

Private Attributes

edm::Handle< DTDigiCollectionDTDigiHandle
 
edm::EDGetTokenT< DTDigiCollectiondtDigisToken
 
edm::InputTag dtDigiTag
 
int flat_calib_
 
int scenario
 
std::unique_ptr< DTTTrigBaseSynctheSync
 
int timeOffset_
 

Static Private Attributes

static constexpr float bxspacing = 25.0
 
static constexpr float flatcalib = 325.0
 
static constexpr float timeshift = 400.0
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 60 of file CalibratedDigis.cc.

Constructor & Destructor Documentation

◆ CalibratedDigis()

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

Definition at line 87 of file CalibratedDigis.cc.

References CalibratedDigis_cfi::dtDigiTag, get, and edm::ParameterSet::getParameter().

87  {
88  //register your products
89  dtDigiTag = iConfig.getParameter<InputTag>("dtDigiTag");
90  dtDigisToken = consumes<DTDigiCollection>(dtDigiTag);
91 
92  theSync = DTTTrigSyncFactory::get()->create(iConfig.getParameter<string>("tTrigMode"),
93  iConfig.getParameter<ParameterSet>("tTrigModeConfig"),
94  consumesCollector());
95 
96  flat_calib_ = iConfig.getParameter<int>("flat_calib");
97  timeOffset_ = iConfig.getParameter<int>("timeOffset");
98 
99  scenario = iConfig.getParameter<int>("scenario");
100 
101  produces<DTDigiCollection>();
102  //now do what ever other initialization is needed
103 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< DTTTrigBaseSync > theSync
edm::EDGetTokenT< DTDigiCollection > dtDigisToken
scenario
Definition: constants.h:173
edm::InputTag dtDigiTag
#define get

◆ ~CalibratedDigis()

CalibratedDigis::~CalibratedDigis ( )
override

Definition at line 105 of file CalibratedDigis.cc.

105  {
106  // do anything here that needs to be done at destruction time
107  // (e.g. close files, deallocate resources etc.)
108 }

Member Function Documentation

◆ produce()

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

Definition at line 115 of file CalibratedDigis.cc.

References dqmMemoryStats::float, iEvent, cmsdt::MC, eostools::move(), contentValuesFiles::number, cmsdt::SLICE_TEST, and DTWireId::wire().

115  {
116  using namespace edm;
117  theSync->setES(iSetup);
118  iEvent.getByToken(dtDigisToken, DTDigiHandle);
119  DTDigiCollection mydigis;
120 
121  for (const auto& dtLayerIt : *DTDigiHandle) {
122  const DTLayerId& layerId = dtLayerIt.first;
123  for (DTDigiCollection::const_iterator digiIt = dtLayerIt.second.first; digiIt != dtLayerIt.second.second;
124  ++digiIt) {
125  DTWireId wireId(layerId, (*digiIt).wire());
126  float digiTime = (*digiIt).time();
127  int wire = (*digiIt).wire();
128  int number = (*digiIt).number();
129  float newTime = 0;
130  if (flat_calib_ != 0)
131  newTime = digiTime - flatcalib + bxspacing * iEvent.eventAuxiliary().bunchCrossing() + float(timeOffset_);
132  else {
133  if (scenario == MC) //FIX MC
134  newTime = digiTime + bxspacing * timeshift;
135  else if (scenario == SLICE_TEST) //FIX SliceTest
136  newTime = digiTime;
137  else
138  newTime = digiTime - theSync->offset(wireId) + bxspacing * iEvent.eventAuxiliary().bunchCrossing() +
140  }
141  DTDigi newDigi(wire, newTime, number);
142  mydigis.insertDigi(layerId, newDigi);
143  }
144  }
145  auto CorrectedDTDigiCollection = std::make_unique<DTDigiCollection>(mydigis);
146  iEvent.put(std::move(CorrectedDTDigiCollection));
147 }
int wire() const
Return the wire number.
Definition: DTWireId.h:42
std::unique_ptr< DTTTrigBaseSync > theSync
edm::EDGetTokenT< DTDigiCollection > dtDigisToken
scenario
Definition: constants.h:173
int iEvent
Definition: GenABIO.cc:224
static constexpr float bxspacing
edm::Handle< DTDigiCollection > DTDigiHandle
Definition: DTDigi.h:17
static constexpr float timeshift
std::vector< DigiType >::const_iterator const_iterator
HLT enums.
static constexpr float flatcalib
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ bxspacing

constexpr float CalibratedDigis::bxspacing = 25.0
staticprivate

Definition at line 79 of file CalibratedDigis.cc.

◆ DTDigiHandle

edm::Handle<DTDigiCollection> CalibratedDigis::DTDigiHandle
private

Definition at line 76 of file CalibratedDigis.cc.

◆ dtDigisToken

edm::EDGetTokenT<DTDigiCollection> CalibratedDigis::dtDigisToken
private

Definition at line 75 of file CalibratedDigis.cc.

◆ dtDigiTag

edm::InputTag CalibratedDigis::dtDigiTag
private

Definition at line 77 of file CalibratedDigis.cc.

◆ flat_calib_

int CalibratedDigis::flat_calib_
private

Definition at line 67 of file CalibratedDigis.cc.

◆ flatcalib

constexpr float CalibratedDigis::flatcalib = 325.0
staticprivate

Definition at line 81 of file CalibratedDigis.cc.

◆ scenario

int CalibratedDigis::scenario
private

Definition at line 68 of file CalibratedDigis.cc.

Referenced by validation.Sample::digest().

◆ theSync

std::unique_ptr<DTTTrigBaseSync> CalibratedDigis::theSync
private

Definition at line 72 of file CalibratedDigis.cc.

◆ timeOffset_

int CalibratedDigis::timeOffset_
private

Definition at line 66 of file CalibratedDigis.cc.

◆ timeshift

constexpr float CalibratedDigis::timeshift = 400.0
staticprivate

Definition at line 80 of file CalibratedDigis.cc.