CMS 3D CMS Logo

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

#include <DTTPDeadWriter.h>

Inheritance diagram for DTTPDeadWriter:
edm::EDAnalyzer 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...
 
 ~DTTPDeadWriter () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool debug
 
edm::ESHandle< DTGeometrymuonGeom
 
DTDeadFlagtpDeadList
 
const DTT0tZeroMap
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 25 of file DTTPDeadWriter.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 36 of file DTTPDeadWriter.cc.

References gather_cfg::cout, debug, and edm::ParameterSet::getUntrackedParameter().

36  {
37  // get selected debug option
38  debug = pset.getUntrackedParameter<bool>("debug", false);
39 
40  // Create the object to be written to DB
41  tpDeadList = new DTDeadFlag();
42 
43  if (debug)
44  cout << "[DTTPDeadWriter]Constructor called!" << endl;
45 }
T getUntrackedParameter(std::string const &, T const &) const
DTDeadFlag * tpDeadList
DTTPDeadWriter::~DTTPDeadWriter ( )
override

Destructor.

Definition at line 48 of file DTTPDeadWriter.cc.

References gather_cfg::cout, and debug.

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

Member Function Documentation

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

Compute the ttrig by fiting the TB rising edge.

Definition at line 64 of file DTTPDeadWriter.cc.

References gather_cfg::cout, DTTopology::firstChannel(), DTTimeUnits::ns, FrontierCondition_GT_autoExpress_cfi::t0, and tzero.

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

Read t0 map from event.

Definition at line 53 of file DTTPDeadWriter.cc.

References edm::EventSetup::get(), and FrontierCondition_GT_autoExpress_cfi::t0.

53  {
54  // Get the t0 map
56  setup.get<DTT0Rcd>().get(t0);
57  tZeroMap = &*t0;
58 
59  // Get the muon Geometry
60  setup.get<MuonGeometryRecord>().get(muonGeom);
61 }
const DTT0 * tZeroMap
edm::ESHandle< DTGeometry > muonGeom
Definition: DTT0Rcd.h:9
T get() const
Definition: EventSetup.h:73
void DTTPDeadWriter::endJob ( void  )
overridevirtual

Write ttrig in the DB.

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file DTTPDeadWriter.cc.

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

Referenced by o2olib.O2ORunMgr::executeJob().

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

Member Data Documentation

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

Definition at line 56 of file DTTPDeadWriter.h.

DTDeadFlag* DTTPDeadWriter::tpDeadList
private

Definition at line 53 of file DTTPDeadWriter.h.

const DTT0* DTTPDeadWriter::tZeroMap
private

Definition at line 50 of file DTTPDeadWriter.h.