CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibMuon/DTCalibration/plugins/DTFakeVDriftESProducer.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2008/10/03 08:34:49 $
00005  *  $Revision: 1.2 $
00006  *  \author S. Bolognesi - INFN Torino
00007  */
00008 
00009 // system include files
00010 #include <memory>
00011 #include "boost/shared_ptr.hpp"
00012 
00013 // user include files
00014 #include "CalibMuon/DTCalibration/plugins/DTFakeVDriftESProducer.h"
00015 #include "FWCore/Framework/interface/SourceFactory.h"
00016 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
00017 
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 
00021 #include "CondFormats/DTObjects/interface/DTMtime.h"
00022 #include "CondFormats/DataRecord/interface/DTMtimeRcd.h"
00023 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00024 
00025 DTFakeVDriftESProducer::DTFakeVDriftESProducer(const edm::ParameterSet& pset)
00026 {
00027   //framework
00028   setWhatProduced(this,&DTFakeVDriftESProducer::produce);
00029   findingRecord<DTMtimeRcd>();
00030   
00031   //read constant value for ttrig from cfg
00032   vDrift = pset.getParameter<double>("vDrift");
00033   reso = pset.getParameter<double>("reso");
00034 }
00035 
00036 
00037 DTFakeVDriftESProducer::~DTFakeVDriftESProducer(){
00038 }
00039 
00040 // ------------ method called to produce the data  ------------
00041 DTMtime* DTFakeVDriftESProducer::produce(const DTMtimeRcd& iRecord){
00042 
00043   DTMtime* mTimerMap = new DTMtime();
00044 
00045   for (int wheel=-2; wheel<3; wheel++){
00046     for(int station=1; station<5; station++){
00047       for(int sector=1; sector<13; sector++){
00048         for(int superlayer=1; superlayer<4; superlayer++){
00049           if(superlayer==2 && station==4) continue;
00050           DTSuperLayerId slId(DTChamberId(wheel, station, sector),superlayer);
00051           mTimerMap->set(slId, vDrift, reso, DTVelocityUnits::cm_per_ns);
00052         }
00053       }
00054     }
00055   }
00056 
00057    for (int wheel=-2; wheel<3; wheel++){
00058      for(int superlayer=1; superlayer<4; superlayer++){
00059        if(superlayer==2) continue;
00060        DTSuperLayerId slId(DTChamberId(wheel, 4, 13),superlayer);
00061          mTimerMap->set(slId, vDrift, reso, DTVelocityUnits::cm_per_ns);
00062      }  
00063    }
00064 
00065    for (int wheel=-2; wheel<3; wheel++){
00066      for(int superlayer=1; superlayer<4; superlayer++){
00067        if(superlayer==2) continue;
00068        DTSuperLayerId slId(DTChamberId(wheel, 4, 14),superlayer);
00069          mTimerMap->set(slId, vDrift, reso, DTVelocityUnits::cm_per_ns);
00070      }  
00071    }
00072    
00073    return mTimerMap;
00074 }
00075 
00076  void DTFakeVDriftESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&,
00077  edm::ValidityInterval & oValidity)
00078  {
00079  oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime());
00080  
00081  }