@@ -22,21 +22,19 @@ using namespace edm;
2222using namespace std ;
2323
2424DTVDriftAnalyzer::DTVDriftAnalyzer (const ParameterSet& pset)
25- : readLegacyVDriftDB(pset.getParameter<bool >(" readLegacyVDriftDB" )) {
25+ : readLegacyVDriftDB(pset.getParameter<bool >(" readLegacyVDriftDB" )) {
2626 // The root file which will contain the histos
2727 string rootFileName = pset.getUntrackedParameter <string>(" rootFileName" );
2828 theFile = new TFile (rootFileName.c_str (), " RECREATE" );
2929 theFile->cd ();
3030 mTimeMapToken_ = esConsumes<edm::Transition::BeginRun>();
3131 vDriftMapToken_ = esConsumes<edm::Transition::BeginRun>();
32-
3332}
3433
3534DTVDriftAnalyzer::~DTVDriftAnalyzer () { theFile->Close (); }
3635
3736void DTVDriftAnalyzer::beginRun (const edm::Run& run, const edm::EventSetup& eventSetup) {
38-
39- edm::LogInfo (" DTVDriftAnalyzer" ) <<" doing beginRun" <<endl;
37+ edm::LogInfo (" DTVDriftAnalyzer" ) << " doing beginRun" << endl;
4038 if (readLegacyVDriftDB) {
4139 ESHandle<DTMtime> mTime = eventSetup.getHandle (mTimeMapToken_ );
4240 mTimeMap = &*mTime ;
@@ -60,44 +58,41 @@ void DTVDriftAnalyzer::endJob() {
6058 // Loop over DB entries
6159
6260 map<uint32_t , pair<float , float >> values;
63-
6461
6562 if (readLegacyVDriftDB) {
66- edm::LogInfo (" DTVDriftAnalyzer" ) << " Reading Legacy VDrift DB" <<endl;
67-
63+ edm::LogInfo (" DTVDriftAnalyzer" ) << " Reading Legacy VDrift DB" << endl;
64+
6865 for (DTMtime::const_iterator mtime = mTimeMap ->begin (); mtime != mTimeMap ->end (); ++mtime) {
69-
7066 // edm::LogInfo("DTVDrift")<< typeid(mtime).name() <<endl;
71-
67+
7268 DTWireId wireId (
73- (*mtime).first .wheelId , (*mtime).first .stationId , (*mtime).first .sectorId , (*mtime).first .slId , 0 , 0 );
69+ (*mtime).first .wheelId , (*mtime).first .stationId , (*mtime).first .sectorId , (*mtime).first .slId , 0 , 0 );
7470 float vdrift;
7571 float reso;
7672 DetId detId (wireId.rawId ());
7773 // vdrift is cm/ns , resolution is cm
7874 mTimeMap ->get (detId, vdrift, reso, DTVelocityUnits::cm_per_ns);
7975 values[wireId.rawId ()] = make_pair (vdrift, reso);
80-
8176 }
82-
77+
8378 } else {
8479 for (DTRecoConditions::const_iterator vd = vDriftMap_->begin (); vd != vDriftMap_->end (); ++vd) {
8580 DTWireId wireId (vd->first );
8681 float vdrift = vDriftMap_->get (wireId);
8782 values[vd->first ] = make_pair (vdrift, 0 .f );
88- }
83+ }
8984 }
9085
9186 for (map<uint32_t , pair<float , float >>::const_iterator it = values.begin (); it != values.end (); ++it) {
9287 float vdrift = it->second .first ;
9388 float reso = it->second .second ;
9489 DTWireId wireId (it->first );
95- if (wireId.wheel ()== 0 && wireId.superlayer ()== 1 )
90+ if (wireId.wheel () == 0 && wireId.superlayer () == 1 )
9691 // Print only for wheel=0 and SL=1
9792 // vdrift is cm/ns , resolution is cm
9893 edm::LogVerbatim (" DTVDriftAnalyzer" ) << " Wire: " << wireId << endl
99- << " vdrift (cm/ns): " << vdrift << endl
100- << " reso (cm): " << reso << endl;
94+ << " vdrift (cm/ns): " << vdrift << endl
95+ << " reso (cm): " << reso << endl;
10196
10297 // Define an histo for each wheel and each superlayer type
10398 TH1D* hVDriftHisto = theVDriftHistoMap[make_pair (wireId.wheel (), wireId.superlayer ())];
0 commit comments