#include <CalibMuon/DTCalibration/plugins/DTTPDeadWriter.h>
Public Member Functions | |
void | analyze (const edm::Event &event, const edm::EventSetup &eventSetup) |
Compute the ttrig by fiting the TB rising edge. | |
void | beginJob (const edm::EventSetup &setup) |
Read t0 map from event. | |
DTTPDeadWriter (const edm::ParameterSet &pset) | |
Constructor. | |
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 GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), edm::ParameterSet::getUntrackedParameter(), and tpDeadList.
00039 { 00040 // get selected debug option 00041 debug = pset.getUntrackedParameter<bool>("debug", "false"); 00042 00043 // Create the object to be written to DB 00044 tpDeadList = new DTDeadFlag(); 00045 00046 if(debug) 00047 cout << "[DTTPDeadWriter]Constructor called!" << endl; 00048 }
DTTPDeadWriter::~DTTPDeadWriter | ( | ) | [virtual] |
Destructor.
Definition at line 51 of file DTTPDeadWriter.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, and lat::endl().
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 DTT0::begin(), DTT0::cellT0(), GenMuonPlsPt100GeV_cfg::cout, DTT0::end(), lat::endl(), DTTopology::firstChannel(), muonGeom, DTTimeUnits::ns, DTDeadFlag::setCellDead_TP(), tpDeadList, tzero, and tZeroMap.
00067 { 00068 set<DTLayerId> analyzedLayers; 00069 00070 //Loop on tzero map 00071 for(DTT0::const_iterator tzero = tZeroMap->begin(); 00072 tzero != tZeroMap->end(); tzero++){ 00073 00074 //Consider what layers have been already considered 00075 DTLayerId layerId = (DTWireId((*tzero).first.wheelId, 00076 (*tzero).first.stationId, 00077 (*tzero).first.sectorId, 00078 (*tzero).first.slId, 00079 (*tzero).first.layerId, 00080 (*tzero).first.cellId)).layerId(); 00081 if(analyzedLayers.find(layerId)==analyzedLayers.end()){ 00082 analyzedLayers.insert(layerId); 00083 00084 //Take the layer topology 00085 const DTTopology& dtTopo = muonGeom->layer(layerId)->specificTopology(); 00086 const int firstWire = dtTopo.firstChannel(); 00087 //const int lastWire = dtTopo.lastChannel(); 00088 const int nWires = muonGeom->layer(layerId)->specificTopology().channels(); 00089 00090 //Loop on wires 00091 for(int wire=firstWire; wire<=nWires; wire++){ 00092 DTWireId wireId(layerId,wire); 00093 float t0 = 0; 00094 float t0rms = 0; 00095 tZeroMap->cellT0(wireId, 00096 t0, 00097 t0rms, 00098 DTTimeUnits::ns); 00099 00100 //If no t0 stored then is a tp dead channel 00101 if(!t0){ 00102 tpDeadList->setCellDead_TP(wireId, true); 00103 cout<<"Wire id "<<wireId<<" is TP dead"<<endl; 00104 } 00105 } 00106 } 00107 } 00108 }
void DTTPDeadWriter::beginJob | ( | 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(), muonGeom, and tZeroMap.
00056 { 00057 // Get the t0 map 00058 ESHandle<DTT0> t0; 00059 setup.get<DTT0Rcd>().get(t0); 00060 tZeroMap = &*t0; 00061 00062 // Get the muon Geometry 00063 setup.get<MuonGeometryRecord>().get(muonGeom); 00064 }
Write ttrig in the DB.
Reimplemented from edm::EDAnalyzer.
Definition at line 111 of file DTTPDeadWriter.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), tpDeadList, and DTCalibDBUtils::writeToDB().
00111 { 00112 if(debug) 00113 cout << "[DTTPDeadWriter]Writing ttrig object to DB!" << endl; 00114 00115 // FIXME: to be read from cfg? 00116 string deadRecord = "DTDeadFlagRcd"; 00117 00118 // Write the object to DB 00119 DTCalibDBUtils::writeToDB(deadRecord, tpDeadList); 00120 00121 }
bool DTTPDeadWriter::debug [private] |
Definition at line 51 of file DTTPDeadWriter.h.
Referenced by DTTPDeadWriter(), endJob(), and ~DTTPDeadWriter().
edm::ESHandle<DTGeometry> DTTPDeadWriter::muonGeom [private] |
DTDeadFlag* DTTPDeadWriter::tpDeadList [private] |
Definition at line 57 of file DTTPDeadWriter.h.
Referenced by analyze(), DTTPDeadWriter(), and endJob().
const DTT0* DTTPDeadWriter::tZeroMap [private] |