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 ()
 
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
 
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)
 
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 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 37 of file DTTPDeadWriter.cc.

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

37  {
38  // get selected debug option
39  debug = pset.getUntrackedParameter<bool>("debug", false);
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 }
T getUntrackedParameter(std::string const &, T const &) const
DTDeadFlag * tpDeadList
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

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

Compute the ttrig by fiting the TB rising edge.

Definition at line 65 of file DTTPDeadWriter.cc.

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

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

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

Write ttrig in the DB.

Reimplemented from edm::EDAnalyzer.

Definition at line 114 of file DTTPDeadWriter.cc.

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

Referenced by o2olib.O2ORunMgr::executeJob().

114  {
115  if(debug)
116  cout << "[DTTPDeadWriter]Writing ttrig object to DB!" << endl;
117 
118  // FIXME: to be read from cfg?
119  string deadRecord = "DTDeadFlagRcd";
120 
121  // Write the object to DB
123 
124 }
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 58 of file DTTPDeadWriter.h.

DTDeadFlag* DTTPDeadWriter::tpDeadList
private

Definition at line 55 of file DTTPDeadWriter.h.

const DTT0* DTTPDeadWriter::tZeroMap
private

Definition at line 52 of file DTTPDeadWriter.h.