Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:17

0001 #include "DataFormats/EcalDigi/interface/EcalTrigPrimCompactColl.h"
0002 
0003 void EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection(EcalTrigPrimDigiCollection& dest) const {
0004   const int nTtEtaBins = 56;
0005   const int nTtPhiBins = 72;
0006   EcalTrigPrimDigiCollection tpColl;
0007   tpColl.reserve(nTtEtaBins * nTtPhiBins);
0008 
0009   for (int zside = -1; zside <= 1; zside += 2) {
0010     for (int iabseta = 1; iabseta <= nTtEtaBins / 2; ++iabseta) {
0011       EcalSubdetector subdet = (iabseta <= 17) ? EcalBarrel : EcalEndcap;
0012       for (int iphi = 1; iphi <= 72; ++iphi) {
0013         const EcalTrigTowerDetId ttId(zside, subdet, iabseta, iphi, EcalTrigTowerDetId::SUBDETIJMODE);
0014         EcalTriggerPrimitiveDigi tp(ttId);
0015         const int rawTp = raw(ttId.ieta(), ttId.iphi());
0016         const EcalTriggerPrimitiveSample tps(rawTp);
0017         tp.setSize(1);
0018         tp.setSample(0, tps);
0019         tpColl.push_back(tp);
0020       }
0021     }
0022   }
0023   tpColl.sort();
0024   dest.swap(tpColl);
0025 }