CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTTPDeadWriter Class Reference

#include <DTTPDeadWriter.h>

Inheritance diagram for DTTPDeadWriter:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 Compute the ttrig by fiting the TB rising edge. More...
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &setup)
 Read t0 map from event. More...
 
 DTTPDeadWriter (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual void endJob ()
 Write ttrig in the DB. More...
 
virtual ~DTTPDeadWriter ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

bool debug
 
edm::ESHandle< DTGeometrymuonGeom
 
DTDeadFlagtpDeadList
 
const DTT0tZeroMap
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 27 of file DTTPDeadWriter.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file DTTPDeadWriter.cc.

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

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

Destructor.

Definition at line 51 of file DTTPDeadWriter.cc.

References gather_cfg::cout, and debug.

51  {
52  if(debug)
53  cout << "[DTTPDeadWriter]Destructor called!" << endl;
54 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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

Compute the ttrig by fiting the TB rising edge.

Implements edm::EDAnalyzer.

Definition at line 67 of file DTTPDeadWriter.cc.

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

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

Read t0 map from event.

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file DTTPDeadWriter.cc.

References edm::EventSetup::get().

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

Write ttrig in the DB.

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file DTTPDeadWriter.cc.

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

116  {
117  if(debug)
118  cout << "[DTTPDeadWriter]Writing ttrig object to DB!" << endl;
119 
120  // FIXME: to be read from cfg?
121  string deadRecord = "DTDeadFlagRcd";
122 
123  // Write the object to DB
125 
126 }
DTDeadFlag * tpDeadList
tuple cout
Definition: gather_cfg.py:121
static void writeToDB(std::string record, T *payload)

Member Data Documentation

bool DTTPDeadWriter::debug
private

Definition at line 51 of file DTTPDeadWriter.h.

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

Definition at line 60 of file DTTPDeadWriter.h.

DTDeadFlag* DTTPDeadWriter::tpDeadList
private

Definition at line 57 of file DTTPDeadWriter.h.

const DTT0* DTTPDeadWriter::tZeroMap
private

Definition at line 54 of file DTTPDeadWriter.h.