121 tree_=
fs_->
make<TTree>(
"L1CaloTowerTree",
"L1CaloTowerTree");
122 tree_->Branch(
"CaloTP",
"L1Analysis::L1AnalysisCaloTPDataFormat", &
caloTPData_, 32000, 3);
123 tree_->Branch(
"L1CaloTower",
"L1Analysis::L1AnalysisL1CaloTowerDataFormat", &
l1CaloTowerData_, 32000, 3);
124 tree_->Branch(
"L1CaloCluster",
"L1Analysis::L1AnalysisL1CaloClusterDataFormat", &
l1CaloClusterData_, 32000, 3);
165 for (
auto itr : *(ecalTPs.
product()) ) {
167 short ieta = (short) itr.id().ieta();
171 unsigned short cal_iphi = (
unsigned short) itr.id().iphi();
172 unsigned short iphi = (72 + 18 - cal_iphi) % 72;
173 unsigned short compEt = itr.compressedEt();
175 unsigned short fineGrain = (
unsigned short) itr.fineGrain();
190 edm::LogWarning(
"L1TNtuple") <<
"ECAL TPs not found, branch will not be filled";
196 for (
auto itr : (*hcalTPs.
product()) ) {
198 int ver = itr.id().version();
199 short ieta = (short) itr.id().ieta();
200 unsigned short absIeta = (
unsigned short)
abs(ieta);
203 unsigned short cal_iphi = (
unsigned short) itr.id().iphi();
204 unsigned short iphi = (72 + 18 - cal_iphi) % 72;
206 unsigned short compEt = itr.SOI_compressedEt();
207 double et = decoder->hcaletValue(itr.id(), itr.t0());
209 unsigned short fineGrain = (
unsigned short) itr.SOI_fineGrain();
211 if (compEt > 0 && (absIeta<29 || ver==1)) {
224 edm::LogWarning(
"L1TNtuple") <<
"HCAL TPs not found, branch will not be filled";
236 for (
int ibx=l1Towers->getFirstBX(); ibx<=l1Towers->getLastBX(); ++ibx) {
238 for (
auto itr = l1Towers->begin(ibx); itr !=l1Towers->end(ibx); ++itr ) {
240 if (itr->hwPt()<=0)
continue;
262 edm::LogWarning(
"L1TNtuple") <<
"L1 Calo Towerss not found, branch will not be filled";
276 for (
int ibx=l1Clusters->getFirstBX(); ibx<=l1Clusters->getLastBX(); ++ibx) {
278 for (
auto itr = l1Clusters->begin(ibx); itr !=l1Clusters->end(ibx); ++itr ) {
280 if (itr->hwPt()<=0)
continue;
299 edm::LogWarning(
"L1TNtuple") <<
"L1 Calo Clusters not found, branch will not be filled";
L1CaloTowerTreeProducer(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
T * make(const Args &...args) const
make new ROOT object
L1Analysis::L1AnalysisCaloTPDataFormat * caloTPData_
~L1CaloTowerTreeProducer()
virtual void beginJob(void)
Abs< T >::type abs(const T &t)
edm::Service< TFileService > fs_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalToken_
T const * product() const
edm::EDGetTokenT< l1t::CaloClusterBxCollection > l1ClusterToken_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
L1Analysis::L1AnalysisL1CaloClusterDataFormat * l1CaloClusterData_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalToken_
edm::EDGetTokenT< l1t::CaloTowerBxCollection > l1TowerToken_
bool isUninitialized() const
L1Analysis::L1AnalysisL1CaloTowerDataFormat * l1CaloTowerData_