Skip to content

Commit adfaa12

Browse files
author
Sunanda
committed
Code check
1 parent 84f13d6 commit adfaa12

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

SimG4CMS/ShowerLibraryProducer/plugins/ZdcTestTreeAnalysis.cc

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
///////////////////////////////////////////////////////////////////////////////
22
// File: ZdcTestTreeAnalysis.cc
33
// Date: 04.25 Lev Kheyn
4-
// Description: simulation analysis code to make a tree needed for making
4+
// Description: simulation analysis code to make a tree needed for making
55
// shower library for ZDC
66
///////////////////////////////////////////////////////////////////////////////
77
#include "DataFormats/Math/interface/Point3D.h"
@@ -49,12 +49,12 @@
4949
#include <vector>
5050

5151
class ZdcTestTreeAnalysis : public SimWatcher,
52-
public Observer<const BeginOfJob*>,
53-
public Observer<const BeginOfRun*>,
54-
public Observer<const EndOfRun*>,
55-
public Observer<const BeginOfEvent*>,
56-
public Observer<const EndOfEvent*>,
57-
public Observer<const G4Step*> {
52+
public Observer<const BeginOfJob*>,
53+
public Observer<const BeginOfRun*>,
54+
public Observer<const EndOfRun*>,
55+
public Observer<const BeginOfEvent*>,
56+
public Observer<const EndOfEvent*>,
57+
public Observer<const G4Step*> {
5858
public:
5959
ZdcTestTreeAnalysis(const edm::ParameterSet& p);
6060
~ZdcTestTreeAnalysis() override;
@@ -71,8 +71,7 @@ class ZdcTestTreeAnalysis : public SimWatcher,
7171
int verbosity_;
7272
TTree* theTree;
7373
int eventIndex, nhits;
74-
int fiberID[2000], npeem[2000], npehad[2000], time[2000];
75-
74+
int fiberID[2000], npeem[2000], npehad[2000], time[2000];
7675
};
7776

7877
ZdcTestTreeAnalysis::ZdcTestTreeAnalysis(const edm::ParameterSet& p) {
@@ -102,7 +101,7 @@ void ZdcTestTreeAnalysis::update(const BeginOfRun* run) {
102101

103102
if (verbosity_ > 0)
104103
edm::LogVerbatim("ZdcTestTreeAnalysis") << "\nZdcTestTreeAnalysis: Begining of Run";
105-
104+
106105
eventIndex = 0;
107106
}
108107

@@ -117,7 +116,6 @@ void ZdcTestTreeAnalysis::update(const G4Step* aStep) {}
117116

118117
//================================================================================================
119118
void ZdcTestTreeAnalysis::update(const EndOfEvent* evt) {
120-
121119
// access to the G4 hit collections
122120
G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
123121
if (verbosity_ > 0)
@@ -135,23 +133,22 @@ void ZdcTestTreeAnalysis::update(const EndOfEvent* evt) {
135133
if (verbosity_ > 0)
136134
edm::LogVerbatim("ZdcTestTreeAnalysis") << " theZDCHC has " << nentries << " entries";
137135

138-
if (nentries > 0) {
139-
140-
for (int ihit = 0; ihit < nentries; ihit++) {
141-
CaloG4Hit* aHit = (*theZDCHC)[ihit];
142-
fiberID[ihit] = aHit->getUnitID();
143-
npeem[ihit] = aHit->getEM();
144-
npehad[ihit] = aHit->getHadr();
145-
time[ihit] = aHit->getTimeSliceID();
146-
147-
if (verbosity_ > 1)
148-
edm::LogVerbatim("ZdcTestTreeAnalysis") << " entry #" << ihit << ": fiaberID=0x" << std::hex << fiberID[ihit] << std::dec << "; npeem=" << npeem[ihit] << "; npehad[ihit]=" << npehad << " time=" << time[ihit];
149-
150-
}
151-
152-
}
153-
nhits = nentries;
154-
theTree->Fill();
136+
if (nentries > 0) {
137+
for (int ihit = 0; ihit < nentries; ihit++) {
138+
CaloG4Hit* aHit = (*theZDCHC)[ihit];
139+
fiberID[ihit] = aHit->getUnitID();
140+
npeem[ihit] = aHit->getEM();
141+
npehad[ihit] = aHit->getHadr();
142+
time[ihit] = aHit->getTimeSliceID();
143+
144+
if (verbosity_ > 1)
145+
edm::LogVerbatim("ZdcTestTreeAnalysis")
146+
<< " entry #" << ihit << ": fiaberID=0x" << std::hex << fiberID[ihit] << std::dec
147+
<< "; npeem=" << npeem[ihit] << "; npehad[ihit]=" << npehad << " time=" << time[ihit];
148+
}
149+
}
150+
nhits = nentries;
151+
theTree->Fill();
155152
}
156153

157154
void ZdcTestTreeAnalysis::update(const EndOfRun* run) {}

0 commit comments

Comments
 (0)