CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/L1TriggerConfig/L1CSCTPConfigProducers/src/L1CSCTriggerPrimitivesConfigProducer.cc

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 //   Class: L1CSCTriggerPrimitivesConfigProducer
00004 //
00005 //   Description: 
00006 //
00007 //   Author: Slava Valuev
00008 //
00009 //-----------------------------------------------------------------------------
00010 
00011 #include <L1TriggerConfig/L1CSCTPConfigProducers/src/L1CSCTriggerPrimitivesConfigProducer.h>
00012 
00013 #include "CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h"
00014 #include "CondFormats/DataRecord/interface/CSCDBL1TPParametersRcd.h"
00015 
00016 //----------------
00017 // Constructors --
00018 //----------------
00019 
00020 L1CSCTriggerPrimitivesConfigProducer::L1CSCTriggerPrimitivesConfigProducer(const edm::ParameterSet& iConfig) {
00021   // the following line is needed to tell the framework what
00022   // data is being produced
00023   setWhatProduced(this);
00024 
00025   // Decide on which of the two sets of parameters will be used.
00026   // (Temporary substitute for the IOV.)
00027   std::string alctParamSet, clctParamSet, tmbParamSet;
00028   bool isMTCC  = iConfig.getParameter<bool>("isMTCC");
00029   bool isTMB07 = iConfig.getParameter<bool>("isTMB07");
00030   if (isMTCC) {
00031     alctParamSet = "alctParamMTCC2";
00032     clctParamSet = "clctParamMTCC2";
00033   }
00034   else if (isTMB07) {
00035     alctParamSet = "alctParamMTCC2";
00036     clctParamSet = "clctParam";
00037   }
00038   else {
00039     alctParamSet = "alctParam";
00040     clctParamSet = "clctParam";
00041   }
00042   tmbParamSet = "tmbParam";
00043 
00044   // get ALCT parameters from the config file
00045   edm::ParameterSet alctParams =
00046     iConfig.getParameter<edm::ParameterSet>(alctParamSet);
00047   m_alct_fifo_tbins   =
00048     alctParams.getParameter<unsigned int>("alctFifoTbins");
00049   m_alct_fifo_pretrig =
00050     alctParams.getParameter<unsigned int>("alctFifoPretrig");
00051   m_alct_drift_delay  =
00052     alctParams.getParameter<unsigned int>("alctDriftDelay");
00053   m_alct_nplanes_hit_pretrig =
00054     alctParams.getParameter<unsigned int>("alctNplanesHitPretrig");
00055   m_alct_nplanes_hit_pattern =
00056     alctParams.getParameter<unsigned int>("alctNplanesHitPattern");
00057   m_alct_nplanes_hit_accel_pretrig =
00058     alctParams.getParameter<unsigned int>("alctNplanesHitAccelPretrig");
00059   m_alct_nplanes_hit_accel_pattern =
00060     alctParams.getParameter<unsigned int>("alctNplanesHitAccelPattern");
00061   m_alct_trig_mode  =
00062     alctParams.getParameter<unsigned int>("alctTrigMode");
00063   m_alct_accel_mode =
00064     alctParams.getParameter<unsigned int>("alctAccelMode");
00065   m_alct_l1a_window_width =
00066     alctParams.getParameter<unsigned int>("alctL1aWindowWidth");
00067 
00068   // get CLCT parameters from the config file
00069   edm::ParameterSet clctParams =
00070     iConfig.getParameter<edm::ParameterSet>(clctParamSet);
00071   m_clct_fifo_tbins   =
00072     clctParams.getParameter<unsigned int>("clctFifoTbins");
00073   m_clct_fifo_pretrig =
00074     clctParams.getParameter<unsigned int>("clctFifoPretrig");
00075   m_clct_hit_persist  =
00076     clctParams.getParameter<unsigned int>("clctHitPersist");
00077   m_clct_drift_delay  =
00078     clctParams.getParameter<unsigned int>("clctDriftDelay");
00079   m_clct_nplanes_hit_pretrig =
00080     clctParams.getParameter<unsigned int>("clctNplanesHitPretrig");
00081   m_clct_nplanes_hit_pattern =
00082     clctParams.getParameter<unsigned int>("clctNplanesHitPattern");
00083   m_clct_pid_thresh_pretrig  =
00084     clctParams.getParameter<unsigned int>("clctPidThreshPretrig");
00085   m_clct_min_separation =
00086     clctParams.getParameter<unsigned int>("clctMinSeparation");
00087 
00088   // get TMB parameters from the config file
00089   edm::ParameterSet tmbParams =
00090     iConfig.getParameter<edm::ParameterSet>(tmbParamSet);
00091   m_tmb_mpc_block_me1a =
00092     tmbParams.getParameter<unsigned int>("tmbMpcBlockMe1a");
00093   m_tmb_alct_trig_enable =
00094     tmbParams.getParameter<unsigned int>("tmbAlctTrigEnable");
00095   m_tmb_clct_trig_enable =
00096     tmbParams.getParameter<unsigned int>("tmbClctTrigEnable");
00097   m_tmb_match_trig_enable =
00098     tmbParams.getParameter<unsigned int>("tmbMatchTrigEnable");
00099   m_tmb_match_trig_window_size =
00100     tmbParams.getParameter<unsigned int>("tmbMatchTrigWindowSize");
00101   m_tmb_tmb_l1a_window_size =
00102     tmbParams.getParameter<unsigned int>("tmbTmbL1aWindowSize");
00103 }
00104 
00105 //----------------
00106 // Destructors  --
00107 //----------------
00108 
00109 L1CSCTriggerPrimitivesConfigProducer::~L1CSCTriggerPrimitivesConfigProducer() {
00110 }
00111 
00112 //------------------
00113 // Member functions
00114 //------------------
00115 
00116 // ------------ method called to produce the data  ------------
00117 std::auto_ptr<CSCDBL1TPParameters>
00118 L1CSCTriggerPrimitivesConfigProducer::produce(const CSCDBL1TPParametersRcd& iRecord) {
00119   using namespace edm::es;
00120   //boost::shared_ptr<L1CSCTriggerPrimitivesConfigProducer> pL1CSCTPConfigProducer;
00121 
00122   // Create empty collection of CSCTPParameters.
00123   std::auto_ptr<CSCDBL1TPParameters> pL1CSCTPParams(new CSCDBL1TPParameters);
00124 
00125   // Set ALCT parameters.
00126   pL1CSCTPParams->setAlctFifoTbins(m_alct_fifo_tbins);
00127   pL1CSCTPParams->setAlctFifoPretrig(m_alct_fifo_pretrig);
00128   pL1CSCTPParams->setAlctDriftDelay(m_alct_drift_delay);
00129   pL1CSCTPParams->setAlctNplanesHitPretrig(m_alct_nplanes_hit_pretrig);
00130   pL1CSCTPParams->setAlctNplanesHitPattern(m_alct_nplanes_hit_pattern);
00131   pL1CSCTPParams->setAlctNplanesHitAccelPretrig(m_alct_nplanes_hit_accel_pretrig);
00132   pL1CSCTPParams->setAlctNplanesHitAccelPattern(m_alct_nplanes_hit_accel_pattern);
00133   pL1CSCTPParams->setAlctTrigMode(m_alct_trig_mode);
00134   pL1CSCTPParams->setAlctAccelMode(m_alct_accel_mode);
00135   pL1CSCTPParams->setAlctL1aWindowWidth(m_alct_l1a_window_width);
00136 
00137   // Set CLCT parameters.
00138   pL1CSCTPParams->setClctFifoTbins(m_clct_fifo_tbins);
00139   pL1CSCTPParams->setClctFifoPretrig(m_clct_fifo_pretrig);
00140   pL1CSCTPParams->setClctHitPersist(m_clct_hit_persist);
00141   pL1CSCTPParams->setClctDriftDelay(m_clct_drift_delay);
00142   pL1CSCTPParams->setClctNplanesHitPretrig(m_clct_nplanes_hit_pretrig);
00143   pL1CSCTPParams->setClctNplanesHitPattern(m_clct_nplanes_hit_pattern);
00144   pL1CSCTPParams->setClctPidThreshPretrig(m_clct_pid_thresh_pretrig);
00145   pL1CSCTPParams->setClctMinSeparation(m_clct_min_separation);
00146 
00147   // Set TMB parameters.
00148   pL1CSCTPParams->setTmbMpcBlockMe1a(m_tmb_mpc_block_me1a);
00149   pL1CSCTPParams->setTmbAlctTrigEnable(m_tmb_alct_trig_enable);
00150   pL1CSCTPParams->setTmbClctTrigEnable(m_tmb_clct_trig_enable);
00151   pL1CSCTPParams->setTmbMatchTrigEnable(m_tmb_match_trig_enable);
00152   pL1CSCTPParams->setTmbMatchTrigWindowSize(m_tmb_match_trig_window_size);
00153   pL1CSCTPParams->setTmbTmbL1aWindowSize(m_tmb_tmb_l1a_window_size);
00154 
00155   //return pL1CSCTPProducer;
00156   return pL1CSCTPParams;
00157 }