CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/CalibMuon/DTCalibration/plugins/DTFakeTTrigESProducer.cc

Go to the documentation of this file.
00001 /*
00002  *  See header file for a description of this class.
00003  *
00004  *  $Date: 2008/12/09 22:44:10 $
00005  *  $Revision: 1.3 $
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/DTFakeTTrigESProducer.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/DTTtrig.h"
00022 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
00023 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00024 
00025 DTFakeTTrigESProducer::DTFakeTTrigESProducer(const edm::ParameterSet& pset)
00026 {
00027   //framework
00028   setWhatProduced(this,&DTFakeTTrigESProducer::produce);
00029   findingRecord<DTTtrigRcd>();
00030   
00031   //read constant value for ttrig from cfg
00032   tMean = pset.getParameter<double>("tMean");
00033   sigma = pset.getParameter<double>("sigma");
00034   kFact = pset.getParameter<double>("kFactor");
00035 }
00036 
00037 
00038 DTFakeTTrigESProducer::~DTFakeTTrigESProducer(){
00039 }
00040 
00041 // ------------ method called to produce the data  ------------
00042 DTTtrig* DTFakeTTrigESProducer::produce(const DTTtrigRcd& iRecord){
00043 
00044   DTTtrig* tTrigMap = new DTTtrig();
00045 
00046   for (int wheel=-2; wheel<3; wheel++){
00047     for(int station=1; station<5; station++){
00048       for(int sector=1; sector<13; sector++){
00049         for(int superlayer=1; superlayer<4; superlayer++){
00050           if(superlayer==2 && station==4) continue;
00051           DTSuperLayerId slId(DTChamberId(wheel, station, sector),superlayer);
00052           tTrigMap->set(slId, tMean, sigma, kFact, DTTimeUnits::ns);
00053         }
00054       }
00055     }
00056   }
00057 
00058    for (int wheel=-2; wheel<3; wheel++){
00059      for(int superlayer=1; superlayer<4; superlayer++){
00060        if(superlayer==2) continue;
00061        DTSuperLayerId slId(DTChamberId(wheel, 4, 13),superlayer);
00062          tTrigMap->set(slId, tMean, sigma, kFact, DTTimeUnits::ns);
00063      }  
00064    }
00065 
00066    for (int wheel=-2; wheel<3; wheel++){
00067      for(int superlayer=1; superlayer<4; superlayer++){
00068        if(superlayer==2) continue;
00069        DTSuperLayerId slId(DTChamberId(wheel, 4, 14),superlayer);
00070          tTrigMap->set(slId, tMean, sigma, kFact, DTTimeUnits::ns);
00071      }  
00072    }
00073    
00074    return tTrigMap;
00075 }
00076 
00077  void DTFakeTTrigESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&,
00078  edm::ValidityInterval & oValidity)
00079  {
00080  oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime());
00081  
00082  }