#include <DTTPDeadWriter.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &event, const edm::EventSetup &eventSetup) |
Compute the ttrig by fiting the TB rising edge. | |
virtual void | beginRun (const edm::Run &, const edm::EventSetup &setup) |
Read t0 map from event. | |
DTTPDeadWriter (const edm::ParameterSet &pset) | |
Constructor. | |
virtual void | endJob () |
Write ttrig in the DB. | |
virtual | ~DTTPDeadWriter () |
Destructor. | |
Private Attributes | |
bool | debug |
edm::ESHandle< DTGeometry > | muonGeom |
DTDeadFlag * | tpDeadList |
const DTT0 * | tZeroMap |
Definition at line 27 of file DTTPDeadWriter.h.
DTTPDeadWriter::DTTPDeadWriter | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 39 of file DTTPDeadWriter.cc.
References gather_cfg::cout, debug, and edm::ParameterSet::getUntrackedParameter().
{ // get selected debug option debug = pset.getUntrackedParameter<bool>("debug", false); // Create the object to be written to DB tpDeadList = new DTDeadFlag(); if(debug) cout << "[DTTPDeadWriter]Constructor called!" << endl; }
DTTPDeadWriter::~DTTPDeadWriter | ( | ) | [virtual] |
Destructor.
Definition at line 51 of file DTTPDeadWriter.cc.
References gather_cfg::cout, and debug.
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.
{ set<DTLayerId> analyzedLayers; //Loop on tzero map for(DTT0::const_iterator tzero = tZeroMap->begin(); tzero != tZeroMap->end(); tzero++){ //Consider what layers have been already considered // @@@ NEW DTT0 FORMAT // DTLayerId layerId = (DTWireId((*tzero).first.wheelId, // (*tzero).first.stationId, // (*tzero).first.sectorId, // (*tzero).first.slId, // (*tzero).first.layerId, // (*tzero).first.cellId)).layerId(); int channelId = tzero->channelId; if ( channelId == 0 ) continue; DTLayerId layerId = (DTWireId(channelId)).layerId(); // @@@ NEW DTT0 END if(analyzedLayers.find(layerId)==analyzedLayers.end()){ analyzedLayers.insert(layerId); //Take the layer topology const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology(); const int firstWire = dtTopo.firstChannel(); //const int lastWire = dtTopo.lastChannel(); const int nWires = muonGeom->layer(layerId)->specificTopology().channels(); //Loop on wires for(int wire=firstWire; wire<=nWires; wire++){ DTWireId wireId(layerId,wire); float t0 = 0; float t0rms = 0; tZeroMap->get(wireId, t0, t0rms, DTTimeUnits::ns); //If no t0 stored then is a tp dead channel if(!t0){ tpDeadList->setCellDead_TP(wireId, true); cout<<"Wire id "<<wireId<<" is TP dead"<<endl; } } } } }
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().
{ // Get the t0 map ESHandle<DTT0> t0; setup.get<DTT0Rcd>().get(t0); tZeroMap = &*t0; // Get the muon Geometry setup.get<MuonGeometryRecord>().get(muonGeom); }
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().
{ if(debug) cout << "[DTTPDeadWriter]Writing ttrig object to DB!" << endl; // FIXME: to be read from cfg? string deadRecord = "DTDeadFlagRcd"; // Write the object to DB DTCalibDBUtils::writeToDB(deadRecord, tpDeadList); }
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.