CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/EcalDigi/src/EcalTrigPrimCompactColl.cc

Go to the documentation of this file.
00001 #include "DataFormats/EcalDigi/interface/EcalTrigPrimCompactColl.h"
00002 
00003 void EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection(EcalTrigPrimDigiCollection& dest) const{
00004   const int nTtEtaBins = 56;
00005   const int nTtPhiBins = 72;
00006   EcalTrigPrimDigiCollection tpColl;
00007   tpColl.reserve(nTtEtaBins*nTtPhiBins);
00008   
00009   for(int zside = -1; zside <= 1; zside +=2){
00010     for(int iabseta = 1; iabseta <= nTtEtaBins/2; ++iabseta){
00011       EcalSubdetector subdet = (iabseta <= 17) ? EcalBarrel : EcalEndcap;
00012       for(int iphi = 1; iphi <= 72; ++iphi){
00013         const EcalTrigTowerDetId ttId(zside, subdet, iabseta, iphi, EcalTrigTowerDetId::SUBDETIJMODE);
00014         EcalTriggerPrimitiveDigi tp(ttId);
00015         const int rawTp = raw(ttId.ieta(), ttId.iphi());
00016         const EcalTriggerPrimitiveSample tps(rawTp);
00017         tp.setSize(1);
00018         tp.setSample(0, tps);
00019         tpColl.push_back(tp);
00020       }
00021     }
00022   }
00023   tpColl.sort();
00024   dest.swap(tpColl);
00025 }