CMS 3D CMS Logo

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

#include <DTTPDeadWriter.h>

Inheritance diagram for DTTPDeadWriter:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 Compute the ttrig by fiting the TB rising edge. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &setup) override
 Read t0 map from event. More...
 
 DTTPDeadWriter (const edm::ParameterSet &pset)
 Constructor. More...
 
void endJob () override
 Write ttrig in the DB. More...
 
void endRun (const edm::Run &, const edm::EventSetup &setup) override
 
 ~DTTPDeadWriter () override
 Destructor. More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool debug
 
const edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeomToken_
 
edm::ESHandle< DTGeometrymuonGeom
 
edm::ESGetToken< DTT0, DTT0Rcdt0Token_
 
DTDeadFlagtpDeadList
 
const DTT0tZeroMap
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 28 of file DTTPDeadWriter.h.

Constructor & Destructor Documentation

◆ DTTPDeadWriter()

DTTPDeadWriter::DTTPDeadWriter ( const edm::ParameterSet pset)

Constructor.

Definition at line 36 of file DTTPDeadWriter.cc.

References edm::BeginRun, gather_cfg::cout, debug, muonDTDigis_cfi::pset, t0Token_, and tpDeadList.

36  : dtGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
37  // get selected debug option
38  debug = pset.getUntrackedParameter<bool>("debug", false);
39  t0Token_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", pset.getParameter<string>("debug")));
40 
41  // Create the object to be written to DB
42  tpDeadList = new DTDeadFlag();
43 
44  if (debug)
45  cout << "[DTTPDeadWriter]Constructor called!" << endl;
46 }
DTDeadFlag * tpDeadList
edm::ESGetToken< DTT0, DTT0Rcd > t0Token_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_

◆ ~DTTPDeadWriter()

DTTPDeadWriter::~DTTPDeadWriter ( )
override

Destructor.

Definition at line 49 of file DTTPDeadWriter.cc.

References gather_cfg::cout, and debug.

49  {
50  if (debug)
51  cout << "[DTTPDeadWriter]Destructor called!" << endl;
52 }

Member Function Documentation

◆ analyze()

void DTTPDeadWriter::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Compute the ttrig by fiting the TB rising edge.

Implements edm::one::EDAnalyzerBase.

Definition at line 63 of file DTTPDeadWriter.cc.

References DTT0::begin(), DTTopology::channels(), gather_cfg::cout, DTT0::end(), DTTopology::firstChannel(), DTT0::get(), DTGeometry::layer(), muonGeom, DTTimeUnits::ns, DTDeadFlag::setCellDead_TP(), DTLayer::specificTopology(), FrontierCondition_GT_autoExpress_cfi::t0, tpDeadList, tzero, tZeroMap, and nano_mu_digi_cff::wire.

63  {
64  set<DTLayerId> analyzedLayers;
65 
66  //Loop on tzero map
68  //Consider what layers have been already considered
69  // @@@ NEW DTT0 FORMAT
70  // DTLayerId layerId = (DTWireId((*tzero).first.wheelId,
71  // (*tzero).first.stationId,
72  // (*tzero).first.sectorId,
73  // (*tzero).first.slId,
74  // (*tzero).first.layerId,
75  // (*tzero).first.cellId)).layerId();
76  int channelId = tzero->channelId;
77  if (channelId == 0)
78  continue;
79  DTLayerId layerId = (DTWireId(channelId)).layerId();
80  // @@@ NEW DTT0 END
81  if (analyzedLayers.find(layerId) == analyzedLayers.end()) {
82  analyzedLayers.insert(layerId);
83 
84  //Take the layer topology
85  const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology();
86  const int firstWire = dtTopo.firstChannel();
87  //const int lastWire = dtTopo.lastChannel();
88  const int nWires = muonGeom->layer(layerId)->specificTopology().channels();
89 
90  //Loop on wires
91  for (int wire = firstWire; wire <= nWires; wire++) {
92  DTWireId wireId(layerId, wire);
93  float t0 = 0;
94  float t0rms = 0;
95  tZeroMap->get(wireId, t0, t0rms, DTTimeUnits::ns);
96 
97  //If no t0 stored then is a tp dead channel
98  if (!t0) {
99  tpDeadList->setCellDead_TP(wireId, true);
100  cout << "Wire id " << wireId << " is TP dead" << endl;
101  }
102  }
103  }
104  }
105 }
const DTT0 * tZeroMap
DTDeadFlag * tpDeadList
const_iterator end() const
Definition: DTT0.cc:147
std::vector< DTT0Data >::const_iterator const_iterator
Access methods to data.
Definition: DTT0.h:122
const_iterator begin() const
Definition: DTT0.cc:145
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
int setCellDead_TP(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag)
Definition: DTDeadFlag.cc:218
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:48
edm::ESHandle< DTGeometry > muonGeom
static const double tzero[3]
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96

◆ beginRun()

void DTTPDeadWriter::beginRun ( const edm::Run ,
const edm::EventSetup setup 
)
override

Read t0 map from event.

Definition at line 54 of file DTTPDeadWriter.cc.

References dtGeomToken_, muonGeom, singleTopDQM_cfi::setup, t0Token_, and tZeroMap.

54  {
55  // Get the t0 map
56  tZeroMap = &setup.getData(t0Token_);
57 
58  // Get the muon Geometry
59  muonGeom = setup.getHandle(dtGeomToken_);
60 }
const DTT0 * tZeroMap
edm::ESHandle< DTGeometry > muonGeom
edm::ESGetToken< DTT0, DTT0Rcd > t0Token_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_

◆ endJob()

void DTTPDeadWriter::endJob ( void  )
overridevirtual

Write ttrig in the DB.

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 108 of file DTTPDeadWriter.cc.

References gather_cfg::cout, debug, tpDeadList, and DTCalibDBUtils::writeToDB().

Referenced by o2olib.O2ORunMgr::executeJob().

108  {
109  if (debug)
110  cout << "[DTTPDeadWriter]Writing ttrig object to DB!" << endl;
111 
112  // FIXME: to be read from cfg?
113  string deadRecord = "DTDeadFlagRcd";
114 
115  // Write the object to DB
117 }
static void writeToDB(std::string record, const T &payload)
DTDeadFlag * tpDeadList

◆ endRun()

void DTTPDeadWriter::endRun ( const edm::Run ,
const edm::EventSetup setup 
)
inlineoverride

Definition at line 44 of file DTTPDeadWriter.h.

44 {};

Member Data Documentation

◆ debug

bool DTTPDeadWriter::debug
private

◆ dtGeomToken_

const edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTTPDeadWriter::dtGeomToken_
private

Definition at line 63 of file DTTPDeadWriter.h.

Referenced by beginRun().

◆ muonGeom

edm::ESHandle<DTGeometry> DTTPDeadWriter::muonGeom
private

Definition at line 62 of file DTTPDeadWriter.h.

Referenced by analyze(), and beginRun().

◆ t0Token_

edm::ESGetToken<DTT0, DTT0Rcd> DTTPDeadWriter::t0Token_
private

Definition at line 56 of file DTTPDeadWriter.h.

Referenced by beginRun(), and DTTPDeadWriter().

◆ tpDeadList

DTDeadFlag* DTTPDeadWriter::tpDeadList
private

Definition at line 59 of file DTTPDeadWriter.h.

Referenced by analyze(), DTTPDeadWriter(), and endJob().

◆ tZeroMap

const DTT0* DTTPDeadWriter::tZeroMap
private

Definition at line 55 of file DTTPDeadWriter.h.

Referenced by analyze(), and beginRun().