CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1DummyProducer Class Reference

#include <L1DummyProducer.h>

Inheritance diagram for L1DummyProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 L1DummyProducer (const edm::ParameterSet &)
template<>
void SimpleDigi (std::auto_ptr< L1CSCTrackCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< EcalTrigPrimDigiCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< LTCDigiCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuGMTReadoutCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuGMTCandCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuDTChambThContainer > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuDTChambPhContainer > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuDTTrackContainer > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1MuRegionalCandCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1GctJetCandCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1GctEmCandCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1CaloRegionCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< L1CaloEmCollection > &data, int type)
template<>
void SimpleDigi (std::auto_ptr< CSCCorrelatedLCTDigiCollection > &data, int type)
template<class T >
void SimpleDigi (std::auto_ptr< T > &data, int type=0)
 ~L1DummyProducer ()

Private Member Functions

virtual void beginJob (void)
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)
int verbose ()

Private Attributes

double EBase_
double ESigm_
std::string instName [dedefs::DEnsys][5]
bool m_doSys [dedefs::DEnsys]
int nevt_
CLHEP::RandFlat * rndFlat_
CLHEP::RandGaussQ * rndGaus_
int verbose_

Detailed Description

Definition at line 40 of file L1DummyProducer.h.


Constructor & Destructor Documentation

L1DummyProducer::L1DummyProducer ( const edm::ParameterSet iConfig) [explicit]

assertions/temporary

list of collections to be produced

rnd # settings

Definition at line 5 of file L1DummyProducer.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, dedefs::ETP, dedefs::GCT, edm::ParameterSet::getUntrackedParameter(), dedefs::GLT, dedefs::GMT, dedefs::HTP, i, j, dedefs::LTC, dedefs::RCT, dedefs::RPC, dedefs::SystLabel, and validate_alignment_devdb10_cfg::verbose.

                                                               {

  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag",0);
  
  if(verbose())
    std::cout << "L1DummyProducer::L1DummyProducer...\n" << std::flush;

  std::vector<unsigned int> compColls  
    = iConfig.getUntrackedParameter<std::vector<unsigned int> >("DO_SYSTEM");

  for(int i=0; i<DEnsys; i++) 
    m_doSys[i] = compColls[i];
  
  if(verbose()) {
    std::cout << "[L1DummyProducer] do sys? ";
    for(int i=0; i<DEnsys; i++)
      std::cout << m_doSys[i];
    std::cout << std::endl;  
    for(int i=0; i<DEnsys; i++)
      if(m_doSys[i]) 
        std::cout << SystLabel[i] << " ";
    std::cout << std::endl;  
  }

  std::string CollInstName[DEnsys][5];
  for(int i=0; i<DEnsys; i++)
    for(int j=0; j<5; j++)
      CollInstName[i][j]=std::string("");

  CollInstName[GCT][0]+="isoEm"   ;
  CollInstName[GCT][1]+="nonIsoEm";
  CollInstName[GCT][2]+="cenJets" ;
  CollInstName[GCT][3]+="forJets" ;
  CollInstName[GCT][4]+="tauJets" ;
  CollInstName[DTF][0]+="DT"      ;
  CollInstName[DTF][1]+="DTTF"    ;
  CollInstName[CTF][0]+="CSC"     ;
  CollInstName[CTF][1]+=""        ;
  CollInstName[RPC][0]+="RPCb"    ;
  CollInstName[RPC][1]+="RPCf"    ;
  
  for(int i=0; i<DEnsys; i++)
    for(int j=0; j<5; j++)
      instName[i][j] = CollInstName[i][j];

  if(verbose()) {
    std::cout << "[L1DummyProducer] instName:\n";
    for(int i=0; i<DEnsys; i++)
      for(int j=0; j<5; j++)
        if(instName[i][j] != "")
          std::cout << i << " " << SystLabel[i] << " " << j << " " 
                    << instName[i][j] << std::endl;
    std::cout << std::flush;
  }

  assert(ETP==0); assert(HTP==1); assert(RCT== 2); assert(GCT== 3);
  assert(DTP==4); assert(DTF==5); assert(CTP== 6); assert(CTF== 7);
  assert(RPC==8); assert(LTC==9); assert(GMT==10); assert(GLT==11);

  if(m_doSys[ETP])  produces<EcalTrigPrimDigiCollection>     (instName[ETP][0]);
  if(m_doSys[HTP])  produces<HcalTrigPrimDigiCollection>     (instName[HTP][0]);
  if(m_doSys[RCT])  produces<L1CaloEmCollection>             (instName[RCT][0]);
  if(m_doSys[RCT])  produces<L1CaloRegionCollection>         (instName[RCT][0]);
  if(m_doSys[GCT])  produces<L1GctEmCandCollection>          (instName[GCT][0]);
  if(m_doSys[GCT])  produces<L1GctEmCandCollection>          (instName[GCT][1]);
  if(m_doSys[GCT])  produces<L1GctJetCandCollection>         (instName[GCT][2]);
  if(m_doSys[GCT])  produces<L1GctJetCandCollection>         (instName[GCT][3]);
  if(m_doSys[GCT])  produces<L1GctJetCandCollection>         (instName[GCT][4]);
  if(m_doSys[DTP])  produces<L1MuDTChambPhContainer>         (instName[DTP][0]);
  if(m_doSys[DTP])  produces<L1MuDTChambThContainer>         (instName[DTP][0]);
  if(m_doSys[DTF])  produces<L1MuRegionalCandCollection>     (instName[DTF][0]);
  if(m_doSys[DTF])  produces<L1MuDTTrackContainer>           (instName[DTF][1]);
  if(m_doSys[CTP])  produces<CSCCorrelatedLCTDigiCollection> (instName[CTP][0]);
  if(m_doSys[CTF])  produces<L1MuRegionalCandCollection>     (instName[CTF][0]);
  if(m_doSys[CTF])  produces<L1CSCTrackCollection>           (instName[CTF][1]);
  if(m_doSys[RPC])  produces<L1MuRegionalCandCollection>     (instName[RPC][0]);
  if(m_doSys[RPC])  produces<L1MuRegionalCandCollection>     (instName[RPC][1]);
  if(m_doSys[LTC])  produces<LTCDigiCollection>              (instName[LTC][0]);
  if(m_doSys[GMT])  produces<L1MuGMTCandCollection>          (instName[GMT][0]);
  if(m_doSys[GMT])  produces<L1MuGMTReadoutCollection>       (instName[GMT][0]);
  if(m_doSys[GLT])  produces<L1GlobalTriggerReadoutRecord>   (instName[GLT][0]);
  if(m_doSys[GLT])  produces<L1GlobalTriggerEvmReadoutRecord>(instName[GLT][0]);
  if(m_doSys[GLT])  produces<L1GlobalTriggerObjectMapRecord> (instName[GLT][0]);

  edm::Service<edm::RandomNumberGenerator> rng;
  CLHEP::HepRandomEngine& engine = rng->getEngine();
  rndFlat_ = new CLHEP::RandFlat  (engine, 0., 1.);
  rndGaus_ = new CLHEP::RandGaussQ(engine, 0., 1.);
  EBase_ = iConfig.getUntrackedParameter<double>("EnergyBase",100.);
  ESigm_ = iConfig.getUntrackedParameter<double>("EnergySigm",10.);

  nevt_=0;
  
}
L1DummyProducer::~L1DummyProducer ( )

Definition at line 103 of file L1DummyProducer.cc.

                                  {
  delete rndFlat_;
  delete rndGaus_;
}

Member Function Documentation

virtual void L1DummyProducer::beginJob ( void  ) [inline, private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 49 of file L1DummyProducer.h.

{};
virtual void L1DummyProducer::endJob ( void  ) [inline, private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 52 of file L1DummyProducer.h.

{};
void L1DummyProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

define the data collections

fill candidate collections

put collection

Implements edm::EDProducer.

Definition at line 109 of file L1DummyProducer.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DTF, dedefs::DTP, dedefs::ETP, dedefs::GCT, dedefs::GLT, dedefs::GMT, dedefs::HTP, dedefs::LTC, edm::Event::put(), dedefs::RCT, dedefs::RPC, and validate_alignment_devdb10_cfg::verbose.

                                                                      {

  if(verbose())
    std::cout << "L1DummyProducer::produce...\n" << std::flush;

  std::auto_ptr<EcalTrigPrimDigiCollection>         ecal_tp_data(new EcalTrigPrimDigiCollection     );
  std::auto_ptr<HcalTrigPrimDigiCollection>         hcal_tp_data(new HcalTrigPrimDigiCollection     );
  std::auto_ptr<L1CaloEmCollection>                  rct_em_data(new L1CaloEmCollection             );
  std::auto_ptr<L1CaloRegionCollection>             rct_rgn_data(new L1CaloRegionCollection         );
  std::auto_ptr<L1GctEmCandCollection>          gct_isolaem_data(new L1GctEmCandCollection          ); 
  std::auto_ptr<L1GctEmCandCollection>          gct_noisoem_data(new L1GctEmCandCollection          ); 
  std::auto_ptr<L1GctJetCandCollection>         gct_cenjets_data(new L1GctJetCandCollection         ); 
  std::auto_ptr<L1GctJetCandCollection>         gct_forjets_data(new L1GctJetCandCollection         ); 
  std::auto_ptr<L1GctJetCandCollection>         gct_taujets_data(new L1GctJetCandCollection         ); 
  std::auto_ptr<L1MuDTChambPhContainer>              dtp_ph_data(new L1MuDTChambPhContainer         );
  std::auto_ptr<L1MuDTChambThContainer>              dtp_th_data(new L1MuDTChambThContainer         );
  std::auto_ptr<L1MuRegionalCandCollection>             dtf_data(new L1MuRegionalCandCollection     );
  std::auto_ptr<L1MuDTTrackContainer>               dtf_trk_data(new L1MuDTTrackContainer           );
  std::auto_ptr<CSCCorrelatedLCTDigiCollection>         ctp_data(new CSCCorrelatedLCTDigiCollection );
  std::auto_ptr<L1MuRegionalCandCollection>             ctf_data(new L1MuRegionalCandCollection     );
  std::auto_ptr<L1CSCTrackCollection>               ctf_trk_data(new L1CSCTrackCollection           );
  std::auto_ptr<L1MuRegionalCandCollection>         rpc_cen_data(new L1MuRegionalCandCollection     );
  std::auto_ptr<L1MuRegionalCandCollection>         rpc_for_data(new L1MuRegionalCandCollection     );
  std::auto_ptr<LTCDigiCollection>                      ltc_data(new LTCDigiCollection              );
  std::auto_ptr<L1MuGMTCandCollection>                  gmt_data(new L1MuGMTCandCollection          );
  std::auto_ptr<L1MuGMTReadoutCollection>           gmt_rdt_data(new L1MuGMTReadoutCollection       ); 
  std::auto_ptr<L1GlobalTriggerReadoutRecord>       glt_rdt_data(new L1GlobalTriggerReadoutRecord   );
  std::auto_ptr<L1GlobalTriggerEvmReadoutRecord>    glt_evm_data(new L1GlobalTriggerEvmReadoutRecord);
  std::auto_ptr<L1GlobalTriggerObjectMapRecord>     glt_obj_data(new L1GlobalTriggerObjectMapRecord );

  if(m_doSys[ETP]) SimpleDigi(    ecal_tp_data  );
  if(m_doSys[HTP]) SimpleDigi(    hcal_tp_data  );
  if(m_doSys[RCT]) SimpleDigi(     rct_em_data  );
  if(m_doSys[RCT]) SimpleDigi(    rct_rgn_data  );
  if(m_doSys[GCT]) SimpleDigi(gct_isolaem_data,0);
  if(m_doSys[GCT]) SimpleDigi(gct_noisoem_data,1);
  if(m_doSys[GCT]) SimpleDigi(gct_cenjets_data,0);
  if(m_doSys[GCT]) SimpleDigi(gct_forjets_data,1);
  if(m_doSys[GCT]) SimpleDigi(gct_taujets_data,2);
  if(m_doSys[DTP]) SimpleDigi(     dtp_ph_data  );
  if(m_doSys[DTP]) SimpleDigi(     dtp_th_data  );
  if(m_doSys[DTF]) SimpleDigi(        dtf_data,0);
  if(m_doSys[DTF]) SimpleDigi(    dtf_trk_data  );
  if(m_doSys[CTP]) SimpleDigi(        ctp_data  );
  if(m_doSys[CTF]) SimpleDigi(        ctf_data,2);
  if(m_doSys[CTF]) SimpleDigi(    ctf_trk_data  );
  if(m_doSys[RPC]) SimpleDigi(    rpc_cen_data,1);
  if(m_doSys[RPC]) SimpleDigi(    rpc_for_data,3);
  if(m_doSys[LTC]) SimpleDigi(        ltc_data  );
  if(m_doSys[GMT]) SimpleDigi(        gmt_data  );
  if(m_doSys[GMT]) SimpleDigi(    gmt_rdt_data  );
  if(m_doSys[GLT]) SimpleDigi(    glt_rdt_data  );
  if(m_doSys[GLT]) SimpleDigi(    glt_evm_data  );
  if(m_doSys[GLT]) SimpleDigi(    glt_obj_data  );

  if(m_doSys[ETP]) iEvent.put(    ecal_tp_data,instName[ETP][0]);
  if(m_doSys[HTP]) iEvent.put(    hcal_tp_data,instName[HTP][0]);
  if(m_doSys[RCT]) iEvent.put(     rct_em_data,instName[RCT][0]);
  if(m_doSys[RCT]) iEvent.put(    rct_rgn_data,instName[RCT][0]);
  if(m_doSys[GCT]) iEvent.put(gct_isolaem_data,instName[GCT][0]);
  if(m_doSys[GCT]) iEvent.put(gct_noisoem_data,instName[GCT][1]);
  if(m_doSys[GCT]) iEvent.put(gct_cenjets_data,instName[GCT][2]);
  if(m_doSys[GCT]) iEvent.put(gct_forjets_data,instName[GCT][3]);
  if(m_doSys[GCT]) iEvent.put(gct_taujets_data,instName[GCT][4]);
  if(m_doSys[DTP]) iEvent.put(     dtp_ph_data,instName[DTP][0]);
  if(m_doSys[DTP]) iEvent.put(     dtp_th_data,instName[DTP][0]);
  if(m_doSys[DTF]) iEvent.put(        dtf_data,instName[DTF][0]);
  if(m_doSys[DTF]) iEvent.put(    dtf_trk_data,instName[DTF][1]);
  if(m_doSys[CTP]) iEvent.put(        ctp_data,instName[CTP][0]);
  if(m_doSys[CTF]) iEvent.put(        ctf_data,instName[CTF][0]);
  if(m_doSys[CTF]) iEvent.put(    ctf_trk_data,instName[CTF][1]);
  if(m_doSys[RPC]) iEvent.put(    rpc_cen_data,instName[RPC][0]);
  if(m_doSys[RPC]) iEvent.put(    rpc_for_data,instName[RPC][1]);
  if(m_doSys[LTC]) iEvent.put(        ltc_data,instName[LTC][0]);
  if(m_doSys[GMT]) iEvent.put(        gmt_data,instName[GMT][0]);
  if(m_doSys[GMT]) iEvent.put(    gmt_rdt_data,instName[GMT][0]);
  if(m_doSys[GLT]) iEvent.put(    glt_rdt_data,instName[GLT][0]);
  if(m_doSys[GLT]) iEvent.put(    glt_evm_data,instName[GLT][0]);
  if(m_doSys[GLT]) iEvent.put(    glt_obj_data,instName[GLT][0]);

  nevt_++;

  if(verbose())
    std::cout << "L1DummyProducer::produce end.\n" << std::flush;
  
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< LTCDigiCollection > &  data,
int  type 
) [inline]

Definition at line 447 of file L1DummyProducer.h.

References gather_cfg::cout, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<LTCDigiCollection>....\n" << std::flush;
  //LTCs are FED id 816-823
  /*  
      6 64-bit words
      uint64_t *ld = (uint64_t*)data;
      
      word0: 59:56  4 bit    ld[0]>>56 & 0xf         trigType
             55:32 24 bit    ld[0]>>32 & 0x00ffffff  eventID
             31:20 12 bit    ld[0]>>20 & 0xfff       bunchNumber
             19: 8 12 bit    ld[0]>> 8 & 0x00000fff  sourceID (816-823?)

      word1: 63:32 32 bit    ld[1]>>32 & 0xffffffff  orbitNumber
             31:24 8 bit     ld[1]>>24 & 0xff        versionNumber
              3: 0 4 bit     ld[1      & 0xf         daqPartition  

      word2: 63:32 32 bit    ld[0]>>32 & 0xffffffff  runNumber
             31: 0 32 bit    ld[0]     & 0xffffffff  eventNumber

      word3: 63:32 32 bit    ld[3]>>32 & 0xffffffff  trigInhibitNumber
             31: 0 32 bit    ld[3]     & 0xffffffff  trigInputStat  

      word4: 63:0 64 bit     ld[4]                   bstGpsTime

      word5: (empty)
  */
  //need to make up something meaningfull to produce here..
  //LTCDigi(const unsigned char* data);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<LTCDigiCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuGMTReadoutCollection > &  data,
int  type 
) [inline]

tbd: add GMT extended cand(!)

Definition at line 399 of file L1DummyProducer.h.

References asciidump::at, gather_cfg::cout, EBase_, ESigm_, eta(), i, nevt_, phi, rndFlat_, rndGaus_, L1MuGMTReadoutRecord::setBxInEvent(), L1MuGMTReadoutRecord::setBxNr(), L1MuGMTReadoutRecord::setEvNr(), L1MuGMTReadoutRecord::setGMTBrlCand(), L1MuGMTReadoutRecord::setGMTCand(), L1MuGMTReadoutRecord::setGMTFwdCand(), L1MuGMTReadoutRecord::setInputCand(), L1MuGMTReadoutRecord::setMIPbit(), L1MuGMTReadoutRecord::setQuietbit(), SimpleDigi(), and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection>....\n" << std::flush;
  L1MuGMTReadoutRecord rec(0);
  int bxn = nevt_;
  rec.setBxNr(bxn);
  rec.setEvNr(bxn);
  rec.setBxInEvent(0); 
  std::auto_ptr<L1MuRegionalCandCollection> trks_dttf(new L1MuRegionalCandCollection);
  std::auto_ptr<L1MuRegionalCandCollection> trks_rpcb(new L1MuRegionalCandCollection);
  std::auto_ptr<L1MuRegionalCandCollection> trks_csc (new L1MuRegionalCandCollection);
  std::auto_ptr<L1MuRegionalCandCollection> trks_rpcf(new L1MuRegionalCandCollection);
  SimpleDigi(trks_dttf,0);
  SimpleDigi(trks_rpcb,1);
  SimpleDigi(trks_csc ,2);
  SimpleDigi(trks_rpcf,3);
  for(int i=0; i<4; i++) {
    rec.setInputCand(i   ,trks_dttf->at(i));//dt  : 0..3
    rec.setInputCand(i+ 4,trks_rpcb->at(i));//rpcb: 4..7
    rec.setInputCand(i+ 8,trks_csc ->at(i));//csc : 8..11
    rec.setInputCand(i+12,trks_rpcf->at(i));//rpcf:12..15
  }
  for(int nr=0; nr<4; nr++) {
    int eng = (int)(EBase_ + ESigm_*rndGaus_->fire());
    rec.setGMTBrlCand(nr, eng&0x11, eng&0x11); //set GMT barrel candidate
    rec.setGMTFwdCand(nr, eng&0x11, eng&0x11); //set GMT forward candidate
    rec.setGMTCand   (nr, eng&0x11);           //set GMT candidate (does not store rank)
    int eta = (int)(14*rndFlat_->fire());      //0..13
    int phi = (int)(18*rndFlat_->fire());      //0..17
    rec.setMIPbit  (eta, phi);
    rec.setQuietbit(eta, phi);
  }
  data->addRecord(rec);
  //rec.setBCERR(int bcerr);
  //rec.setGMTBrlCand(int nr, L1MuGMTExtendedCand const& cand);
  //rec.setGMTFwdCand(int nr, L1MuGMTExtendedCand const& cand);
  //rec.setGMTCand   (int nr, L1MuGMTExtendedCand const& cand);
  //rec.setInputCand (int nr, L1MuRegionalCand const& cand);
  //L1MuGMTReadoutCollection :: std::vector<L1MuGMTReadoutRecord> m_Records;
  //L1MuGMTReadoutCollection(int nbx) { m_Records.reserve(nbx); };
  //L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx=0) : L1MuGMTCand (data, bx), m_rank(rank) {}
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTReadoutCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuGMTCandCollection > &  data,
int  type 
) [inline]

Definition at line 360 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, eta(), nevt_, phi, Pi, csvReporter::r, rndFlat_, rndGaus_, L1MuGMTCand::setBx(), L1MuGMTCand::setChargePacked(), L1MuGMTCand::setEtaPacked(), L1MuGMTCand::setEtaValue(), L1MuGMTCand::setIsolation(), L1MuGMTCand::setMIP(), L1MuGMTCand::setPhiPacked(), L1MuGMTCand::setPhiValue(), L1MuGMTCand::setPtPacked(), L1MuGMTCand::setPtValue(), and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTCandCollection>....\n" << std::flush;
  //typedef std::vector<L1MuGMTCand>          L1MuGMTCandCollection;
  L1MuGMTCand cand(0,nevt_);
  //cand.setPhiPacked();//8bits
  //cand.setPtPacked ();//5bits
  //cand.setQuality  ();//3bits
  //cand.setEtaPacked();//6bits
  //cand.setIsolation();//1bit
  //cand.setMIP      ();//1bit
  //cand.setChargePacked();//0:+, 1:-, 2:undef, 3:sync
  //cand.setBx       (nevt_);
  //set physical values
  double eng = EBase_+ESigm_*rndGaus_->fire();
  double phi = 2*TMath::Pi()*rndFlat_->fire();
  double eta = 2.5*(-1+2*rndFlat_->fire());
  cand.setPtValue (eng); 
  cand.setPhiValue(phi);
  cand.setEtaValue(eta);
  unsigned engp = (unsigned)(EBase_ + ESigm_*rndGaus_->fire());
  unsigned phip = (unsigned)(255*rndFlat_->fire());
  unsigned etap = (unsigned)( 63*rndFlat_->fire());
  cand.setPtPacked (engp&0x1f);
  cand.setPhiPacked(phip&0x7f);
  cand.setEtaPacked(etap&0x3f);
  double r = rndFlat_->fire();
  cand.setIsolation(r>0.2);
  cand.setMIP(r>0.7);
  cand.setChargePacked(r>0.5?0:1);
  cand.setBx(0);
  data->push_back(cand);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuGMTCandCollection> end.\n" << std::flush;

}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuDTChambThContainer > &  data,
int  type 
) [inline]

Definition at line 331 of file L1DummyProducer.h.

References gather_cfg::cout, i, j, rndFlat_, testEve_cfg::tracks, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambThContainer>....\n" << std::flush;
  typedef std::vector<L1MuDTChambThDigi>  The_Container;
  int ntrk = 4;
  The_Container tracks(ntrk);
  int ubx, uwh, usc, ust, uos[7], uqa[7];
  for (int i=0; i<ntrk; i++) {  
    ubx = 0;
    uwh = (int)(-2+5*rndFlat_->fire());
    usc = (int)(  12*rndFlat_->fire());
    ust = (int)(1.+4*rndFlat_->fire());
    for(int j=0; j<7; j++) {
      uos[j]=(rndFlat_->fire()>0.5?0:1); 
      uqa[j]=(rndFlat_->fire()>0.5?0:1); 
    }
    L1MuDTChambThDigi cand(ubx, uwh, usc, ust, uos, uqa);
    tracks.push_back(cand);
  }
  data->setContainer(tracks);
  //L1MuDTChambThDigi( int ubx, int uwh, int usc, int ust,
  //             int* uos, [int* uqual] );
  //"DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambThContainer> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuDTChambPhContainer > &  data,
int  type 
) [inline]

Definition at line 298 of file L1DummyProducer.h.

References gather_cfg::cout, i, rndFlat_, testEve_cfg::tracks, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer>....\n" << std::flush;
  typedef std::vector<L1MuDTChambPhDigi>  Phi_Container;
  int ntrk = 4;
  Phi_Container tracks(ntrk);
  int ubx, uwh, usc, ust,uphr, uphb, uqua, utag, ucnt;
  for (int i=0; i<ntrk; i++) {  
    ubx  = 0;   //bxNum()  - bx
    uwh  = 0;   //whNum()  - wheel
    usc  = 0;   //scNum()  - sector
    ust  = 0;   //stNum()  - station
    uphr = 0;   //phi()    - radialAngle
    uphb = 0;   //phiB()   - bendingAngle
    uqua = 0;   //code()   - qualityCode
    utag = 0;   //Ts2Tag() - Ts2TagCode
    ucnt = 0;   //BxCnt()  - BxCntCode
    uwh = (int)(-2+5*rndFlat_->fire());
    usc = (int)(  12*rndFlat_->fire());
    ust = (int)(1.+4*rndFlat_->fire());
    uqua= (int)(   8*rndFlat_->fire());
    L1MuDTChambPhDigi cand(ubx, uwh, usc, ust, uphr, uphb, uqua, utag, ucnt);
    tracks.push_back(cand);
  }
  data->setContainer(tracks);
  //L1MuDTChambPhDigi( int ubx, int uwh, int usc, int ust,
  //    int uphr, int uphb, int uqua, int utag, int ucnt );
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTChambPhContainer> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuDTTrackContainer > &  data,
int  type 
) [inline]

Definition at line 272 of file L1DummyProducer.h.

References gather_cfg::cout, L1MuRegionalCand::setBx(), L1MuRegionalCand::setDataWord(), SimpleDigi(), testEve_cfg::tracks, and verbose().

                                         { 
  assert(type==0);
  int type_idx = type; //choose data type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTTrackContainer>....\n" << std::flush;
  std::auto_ptr<L1MuRegionalCandCollection> tracks(new L1MuRegionalCandCollection());
  SimpleDigi(tracks, type_idx);
  typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
  std::auto_ptr<L1MuDTTrackCandCollection> tracksd (new L1MuDTTrackCandCollection());
  for(L1MuRegionalCandCollection::const_iterator it=tracks->begin(); it!=tracks->end(); it++) {
    L1MuDTTrackCand * cnd = new L1MuDTTrackCand();
    cnd->setDataWord(it->getDataWord());
    cnd->setBx(it->bx());
    tracksd->push_back(L1MuDTTrackCand());
    tracksd->push_back(*cnd);
  }
  data->setContainer(*tracksd);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuDTTrackContainer> end.\n" << std::flush;
  //L1MuDTTrackCand( unsigned dataword, int bx, int uwh, int usc, int utag,
  //                 int adr1, int adr2, int adr3, int adr4, int utc );

}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1MuRegionalCandCollection > &  data,
int  type 
) [inline]

Definition at line 237 of file L1DummyProducer.h.

References DeDxDiscriminatorTools::charge(), gather_cfg::cout, eta(), i, phi, Pi, rndFlat_, L1MuRegionalCand::setEtaValue(), L1MuRegionalCand::setPhiValue(), L1MuRegionalCand::setPtValue(), and verbose().

                                           {
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection>....\n" << std::flush;
  //typedef std::vector<L1MuRegionalCand>     L1MuRegionalCandCollection;
  assert(type>=0 && type<4);
  unsigned type_idx=type; //tType: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
  int bx = 0;
  unsigned phi, eta, pt, charge, ch_valid, finehalo, quality;
  float phiv(0.), etav(0.), ptv(0.); //linear translation? 0.2pi,-2.5..2.5,0..100
  for(int i=0; i<4; i++) {
    phi     = (int)(144*rndFlat_->fire()); //8bits, 0..143
    eta     = (int)( 63*rndFlat_->fire()); //6bits code
    phiv    = phi*2*TMath::Pi()/144.; 
    etav    = 2.5*(-1+2*eta/63.);
    pt      = ((int)(32*rndFlat_->fire())) & 0x1f; //5bits: 0..31
    ptv     = 100*(pt/31.);
    charge  = (rndFlat_->fire()>0.5?0:1);;
    ch_valid=0;
    finehalo=0;
    quality = (int)(8*rndFlat_->fire()); //3bits: 0..7
    L1MuRegionalCand cand(type_idx, phi, eta, pt, charge, 
                          ch_valid, finehalo, quality, bx);
    cand.setPhiValue(phiv);
    cand.setEtaValue(etav);
    cand.setPtValue (ptv);
    data->push_back(cand);
  }
  //L1MuRegionalCand(unsigned type_idx, unsigned phi, unsigned eta, unsigned pt, 
  //unsigned charge, unsigned ch_valid, unsigned finehalo, unsigned quality, int bx);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1MuRegionalCandCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< CSCCorrelatedLCTDigiCollection > &  data,
int  type 
) [inline]

Definition at line 481 of file L1DummyProducer.h.

References CSCCorrelatedLCTDigi::clear(), gather_cfg::cout, CSCDetId, rndFlat_, and verbose().

                                                                 { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection>....\n" << std::flush;
  //typedef MuonDigiCollection<CSCDetId,CSCCorrelatedLCTDigi> CSCCorrelatedLCTDigiCollection;
  //CSCCorrelatedLCTDigi(const int trknmb, const int valid, const int quality, const int keywire, const int strip, const int clct_pattern, const int bend, const int bx, const int& mpclink = 0, const uint16_t & bx0=0, const uint16_t & syncErr = 0, const uint16_t & cscID=0);
  CSCCorrelatedLCTDigi dg = CSCCorrelatedLCTDigi();
  //tbd: set non-trivial random values
  dg.clear(); // set contents to zero
  //CSCDetId( int iendcap, int istation, int iring, int ichamber, int ilayer = 0 );
  enum eMinNum{ MIN_ENDCAP=1, MIN_STATION=1, MIN_RING=1, MIN_CHAMBER= 1, MIN_LAYER=1 };
  enum eMaxNum{ MAX_ENDCAP=2, MAX_STATION=4, MAX_RING=4, MAX_CHAMBER=36, MAX_LAYER=6 };
  float rnd = rndFlat_->fire();
  int ec = (int)( MIN_ENDCAP  + (MAX_ENDCAP -MIN_ENDCAP )*rnd +1);
  int st = (int)( MIN_STATION + (MAX_STATION-MIN_STATION)*rnd +1);
  int rg = (int)( MIN_RING    + (MAX_RING   -MIN_RING   )*rnd +1);
  int ch = (int)( MIN_CHAMBER + (MAX_CHAMBER-MIN_CHAMBER)*rnd +1);
  int lr = (int)( MIN_LAYER   + (MAX_LAYER  -MIN_LAYER  )*rnd +1);
  CSCDetId did = CSCDetId(ec,st,rg,ch,lr);
  //CSCDetId did = CSCDetId();   //DetId(DetId::Muon, MuonSubdetId::CSC) 
  //MuonDigiCollection::insertDigi(const IndexType& index, const DigiType& digi)
  data->insertDigi(did,dg);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<CSCCorrelatedLCTDigiCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1GctEmCandCollection > &  data,
int  type 
) [inline]

Definition at line 167 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, eta(), Exception, phi, rndFlat_, rndGaus_, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1GctEmCandCollection>....\n" << std::flush;
  bool iso; //= type==0;
  switch(type) { // 0 iso, 1 noniso
  case 0:  
    iso = true;
    break;
  case 1:  
    iso = false;
    break;
  default:
    throw cms::Exception("L1DummyProducerInvalidType")
      << "L1DummyProducer::SimpleDigi production of L1GctEmCandCollection "
      << " invalid type: " << type << std::endl;
  }
  int      energy= (int) (EBase_ + ESigm_*rndGaus_->fire());
  unsigned rank  = energy & 0x3f;
  unsigned phi   = (unsigned)(18*rndFlat_->fire());
  unsigned eta   = (unsigned)( 7*rndFlat_->fire());
  if(rndFlat_->fire()>0.5) //-z (eta sign)
    eta = (eta&0x7) + (0x1<<3);
  L1GctEmCand cand(rank, phi, eta, iso);
  data->push_back(cand);
  // eta = -6 to -0, +0 to +6. Sign is bit 3, 1 means -ve Z, 0 means +ve Z
  //L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1GctEmCandCollection> end.\n" << std::flush;
}
template<class T >
void L1DummyProducer::SimpleDigi ( std::auto_ptr< T > &  data,
int  type = 0 
)

Definition at line 77 of file L1DummyProducer.h.

Referenced by SimpleDigi().

                                                          {
  /*collections generated in specializations below*/
} 
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1CaloEmCollection > &  data,
int  type 
) [inline]

Definition at line 126 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, getHLTprescales::index, nevt_, rndFlat_, rndGaus_, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CaloEmCollection>....\n" << std::flush;
  int      energy= (int) (EBase_ + ESigm_*rndGaus_->fire());
  unsigned rank  = energy & 0x3f;
  unsigned region= (rndFlat_->fire()>0.5?0:1);
  unsigned card  = (unsigned)(7*rndFlat_->fire()); 
  unsigned crate = (unsigned)(18*rndFlat_->fire());
  bool iso       = (rndFlat_->fire()>0.4); 
  uint16_t index = (unsigned)(4*rndFlat_->fire());
  int16_t  bx    = nevt_;
  L1CaloEmCand cand(rank, region, card, crate, iso, index, bx);
  data->push_back(cand);
  //L1CaloEmCand(unsigned rank, unsigned region, unsigned card, unsigned crate, bool iso, uint16_t index, int16_t bx);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CaloEmCollection> end.\n" << std::flush;
 }
void L1DummyProducer::SimpleDigi ( std::auto_ptr< EcalTrigPrimDigiCollection > &  data,
int  type 
) [inline]

Definition at line 82 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, EcalBarrel, relval_parameters_module::energy, ESigm_, rndFlat_, rndGaus_, EcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), and verbose().

                                         {
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection>....\n" << std::flush;
  int side = (rndFlat_->fire()>0.5)?-1:1;
  int ieta =  (int) (1 + 17*rndFlat_->fire()); //1-17
  int iphi =  (int) (1 + 72*rndFlat_->fire()); //1-72
  const EcalTrigTowerDetId e_id( side , EcalBarrel, ieta, iphi, 0);
  EcalTriggerPrimitiveDigi e_digi(e_id);
  int energy = (int) (EBase_ + ESigm_*rndGaus_->fire());
  bool fg = (rndFlat_->fire()>0.5);
  int ttf = (int)(8*rndFlat_->fire()); //0-7
  EcalTriggerPrimitiveSample e_sample(energy, fg, ttf);
  e_digi.setSize(1); //set sampleOfInterest to 0
  e_digi.setSample(0,e_sample);
  data->push_back(e_digi);
  //EcalTriggerPrimitiveSample(int encodedEt, bool finegrain, int triggerFlag);
  //const EcalTrigTowerDetId e_id( zside , EcalBarrel, etaTT, phiTT, 0);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<EcalTrigPrimDigiCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1GctJetCandCollection > &  data,
int  type 
) [inline]

Definition at line 199 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, eta(), Exception, reco::isTau(), phi, rndFlat_, rndGaus_, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1GctJetCandCollection>....\n" << std::flush;
  bool isFor, isTau;
  switch(type) { // 0 cen, 1 for, 2 tau
  case 0:  
    isFor = false;
    isTau = false;
    break;
  case 1:  
    isFor = true;
    isTau = false;
    break;
  case 2:  
    isFor = false;
    isTau = true;
    break;
  default:
    throw cms::Exception("L1DummyProducerInvalidType")
      << "L1DummyProducer::SimpleDigi production of L1GctJetCandCollection "
      << " invalid type: " << type << std::endl;
  }

  int      energy= (int) (EBase_ + ESigm_*rndGaus_->fire());
  unsigned rank  = energy & 0x3f;
  unsigned phi   = (unsigned)(18*rndFlat_->fire());
  unsigned eta   = (unsigned)( 7*rndFlat_->fire());
  if(rndFlat_->fire()>0.5) //-z (eta sign)
    eta = (eta&0x7) + (0x1<<3);
  L1GctJetCand cand(rank, phi, eta, isTau, isFor);
  data->push_back(cand);
  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1GctJetCandCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1CaloRegionCollection > &  data,
int  type 
) [inline]

Definition at line 146 of file L1DummyProducer.h.

References gather_cfg::cout, EBase_, ESigm_, rndFlat_, rndGaus_, and verbose().

                                         { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CaloRegionCollection>....\n" << std::flush;
  int     energy= (int) (EBase_ + ESigm_*rndGaus_->fire());
  unsigned et   = energy & 0x3ff;
  bool overFlow = 0; //(rndFlat_->fire()>0.4);
  bool tauVeto  = 0; //(rndFlat_->fire()>0.3);
  bool mip      = 0; //(rndFlat_->fire()>0.1);
  bool quiet    = 0; //(rndFlat_->fire()>0.6);
  unsigned crate= (unsigned)(18*rndFlat_->fire());
  unsigned card = (unsigned)(7*rndFlat_->fire());
  unsigned rgn  = crate%2; //(rndFlat_->fire()>0.5?0:1);
  L1CaloRegion cand( et, overFlow, tauVeto, mip, quiet, crate, card, rgn );
  data->push_back(cand);
  //L1CaloRegion(unsigned et, bool overFlow, bool tauVeto, bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn);
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CaloRegionCollection> end.\n" << std::flush;
}
template<>
void L1DummyProducer::SimpleDigi ( std::auto_ptr< L1CSCTrackCollection > &  data,
int  type 
) [inline]

Definition at line 507 of file L1DummyProducer.h.

References L1MuRegionalCand::bx(), gather_cfg::cout, L1MuRegionalCand::etaValue(), L1MuRegionalCand::getDataWord(), L1MuRegionalCand::phiValue(), L1MuRegionalCand::ptValue(), L1MuRegionalCand::setBx(), L1MuRegionalCand::setDataWord(), L1MuRegionalCand::setEtaValue(), L1MuRegionalCand::setPhiValue(), L1MuRegionalCand::setPtValue(), SimpleDigi(), and verbose().

                                                                 { 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CSCTrackCollection>...\n" << std::flush;
  std::auto_ptr<CSCCorrelatedLCTDigiCollection> dgcoll(new CSCCorrelatedLCTDigiCollection);
  SimpleDigi(dgcoll,0);
  csc::L1Track l1trk = csc::L1Track();
  std::auto_ptr<L1MuRegionalCandCollection> regcoll(new L1MuRegionalCandCollection);
  SimpleDigi(regcoll,2);
  L1MuRegionalCand regcand = *(regcoll->begin());
  l1trk.setDataWord(regcand.getDataWord());
  l1trk.setBx(regcand.bx());
  l1trk.setPhiValue(regcand.phiValue());
  l1trk.setEtaValue(regcand.etaValue());
  l1trk.setPtValue (regcand.ptValue());
  L1CSCTrack l1csctrk = std::make_pair(l1trk,*dgcoll);
  data->push_back(l1csctrk);
  //typedef std::vector<L1CSCTrack> L1CSCTrackCollection;
  //typedef std::pair<csc::L1Track,CSCCorrelatedLCTDigiCollection> L1CSCTrack;
  //L1Track() : L1MuRegionalCand(), m_name("csc::L1Track") { setType(2); setPtPacked(0); }
  //L1MuRegionalCand(unsigned dataword = 0, int bx = 0); 
  if(verbose())
    std::cout << "L1DummyProducer::SimpleDigi<L1CSCTrackCollection> end.\n" << std::flush;
 }
int L1DummyProducer::verbose ( ) [inline, private]

Definition at line 62 of file L1DummyProducer.h.

References verbose_.

Referenced by SimpleDigi().

{return verbose_;}

Member Data Documentation

double L1DummyProducer::EBase_ [private]

Definition at line 70 of file L1DummyProducer.h.

Referenced by SimpleDigi().

double L1DummyProducer::ESigm_ [private]

Definition at line 71 of file L1DummyProducer.h.

Referenced by SimpleDigi().

std::string L1DummyProducer::instName[dedefs::DEnsys][5] [private]

Definition at line 66 of file L1DummyProducer.h.

Definition at line 65 of file L1DummyProducer.h.

int L1DummyProducer::nevt_ [private]

Definition at line 63 of file L1DummyProducer.h.

Referenced by SimpleDigi().

CLHEP::RandFlat* L1DummyProducer::rndFlat_ [private]

Definition at line 68 of file L1DummyProducer.h.

Referenced by SimpleDigi().

CLHEP::RandGaussQ* L1DummyProducer::rndGaus_ [private]

Definition at line 69 of file L1DummyProducer.h.

Referenced by SimpleDigi().

Definition at line 61 of file L1DummyProducer.h.

Referenced by verbose().