CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::MinBias Class Reference

#include <MinBias.h>

Inheritance diagram for cms::MinBias:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endJob () override
 
 MinBias (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool allowMissingInputs_
 
int depth
 
float eta
 
const CaloGeometrygeo_
 
std::string hbheLabel_
 
edm::EDGetTokenT< HBHERecHitCollectionhbheToken_
 
std::string hfLabel_
 
edm::EDGetTokenT< HFRecHitCollectionhfToken_
 
std::string hoLabel_
 
edm::EDGetTokenT< HORecHitCollectionhoToken_
 
int ieta
 
int iphi
 
float mom1
 
float mom2
 
float mom3
 
float mom4
 
int mydet
 
int mysubd
 
TTree * myTree_
 
float occup
 
float phi
 
std::map< DetId, double > theFillDetMap0_
 
std::map< DetId, double > theFillDetMap1_
 
std::map< DetId, double > theFillDetMap2_
 
std::map< DetId, double > theFillDetMap3_
 
std::map< DetId, double > theFillDetMap4_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 32 of file MinBias.h.

Constructor & Destructor Documentation

◆ MinBias()

cms::MinBias::MinBias ( const edm::ParameterSet iConfig)
explicit

Definition at line 10 of file MinBias.cc.

References allowMissingInputs_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hbheLabel_, hbheToken_, hfLabel_, hfToken_, hoLabel_, hoToken_, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

10  : geo_(nullptr) {
11  // get names of modules, producing object collections
12  hbheLabel_ = iConfig.getParameter<std::string>("hbheInput");
13  hoLabel_ = iConfig.getParameter<std::string>("hoInput");
14  hfLabel_ = iConfig.getParameter<std::string>("hfInput");
15  hbheToken_ = mayConsume<HBHERecHitCollection>(edm::InputTag(hbheLabel_));
16  hoToken_ = mayConsume<HORecHitCollection>(edm::InputTag(hoLabel_));
17  hfToken_ = mayConsume<HFRecHitCollection>(edm::InputTag(hfLabel_));
18  allowMissingInputs_ = iConfig.getUntrackedParameter<bool>("AllowMissingInputs", false);
19  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< HFRecHitCollection > hfToken_
Definition: MinBias.h:48
std::string hoLabel_
Definition: MinBias.h:45
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HORecHitCollection > hoToken_
Definition: MinBias.h:47
const CaloGeometry * geo_
Definition: MinBias.h:58
bool allowMissingInputs_
Definition: MinBias.h:50
edm::EDGetTokenT< HBHERecHitCollection > hbheToken_
Definition: MinBias.h:46
std::string hbheLabel_
Definition: MinBias.h:45
std::string hfLabel_
Definition: MinBias.h:45

Member Function Documentation

◆ analyze()

void cms::MinBias::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 108 of file MinBias.cc.

References allowMissingInputs_, photonIsolationHIProducer_cfi::hbhe, hbheLabel_, hbheToken_, photonIsolationHIProducer_cfi::hf, hfLabel_, hfToken_, photonIsolationHIProducer_cfi::ho, hoLabel_, hoToken_, triggerObjects_cff::id, iEvent, funct::pow(), theFillDetMap0_, theFillDetMap1_, theFillDetMap2_, theFillDetMap3_, and theFillDetMap4_.

108  {
109  if (!hbheLabel_.empty()) {
111  iEvent.getByToken(hbheToken_, hbhe);
112  if (!hbhe.isValid()) {
113  // can't find it!
114  if (!allowMissingInputs_) {
115  *hbhe; // will throw the proper exception
116  }
117  } else {
118  for (auto const& hbheItr : (HBHERecHitCollection)(*hbhe)) {
119  DetId id = (hbheItr).detid();
120  if (hbheItr.energy() > 0.)
121  edm::LogWarning("MinBias") << " Energy = " << hbheItr.energy();
122  theFillDetMap0_[id] += 1.;
123  theFillDetMap1_[id] += hbheItr.energy();
124  theFillDetMap2_[id] += pow(hbheItr.energy(), 2);
125  theFillDetMap3_[id] += pow(hbheItr.energy(), 3);
126  theFillDetMap4_[id] += pow(hbheItr.energy(), 4);
127  }
128  }
129  }
130 
131  if (!hoLabel_.empty()) {
133  iEvent.getByToken(hoToken_, ho);
134  if (!ho.isValid()) {
135  // can't find it!
136  if (!allowMissingInputs_) {
137  *ho; // will throw the proper exception
138  }
139  } else {
140  for (auto const& hoItr : (HORecHitCollection)(*ho)) {
141  DetId id = hoItr.detid();
142  theFillDetMap0_[id] += 1.;
143  theFillDetMap1_[id] += hoItr.energy();
144  theFillDetMap2_[id] += pow(hoItr.energy(), 2);
145  theFillDetMap3_[id] += pow(hoItr.energy(), 3);
146  theFillDetMap4_[id] += pow(hoItr.energy(), 4);
147  }
148  }
149  }
150 
151  if (!hfLabel_.empty()) {
153  iEvent.getByToken(hfToken_, hf);
154  if (!hf.isValid()) {
155  // can't find it!
156  if (!allowMissingInputs_) {
157  *hf; // will throw the proper exception
158  }
159  } else {
160  for (auto const hfItr : (HFRecHitCollection)(*hf)) {
161  DetId id = hfItr.detid();
162  theFillDetMap0_[id] += 1.;
163  theFillDetMap1_[id] += hfItr.energy();
164  theFillDetMap2_[id] += pow(hfItr.energy(), 2);
165  theFillDetMap3_[id] += pow(hfItr.energy(), 3);
166  theFillDetMap4_[id] += pow(hfItr.energy(), 4);
167  }
168  }
169  }
170  }
edm::EDGetTokenT< HFRecHitCollection > hfToken_
Definition: MinBias.h:48
std::map< DetId, double > theFillDetMap4_
Definition: MinBias.h:64
std::map< DetId, double > theFillDetMap3_
Definition: MinBias.h:63
std::string hoLabel_
Definition: MinBias.h:45
std::map< DetId, double > theFillDetMap0_
Definition: MinBias.h:60
edm::EDGetTokenT< HORecHitCollection > hoToken_
Definition: MinBias.h:47
bool allowMissingInputs_
Definition: MinBias.h:50
int iEvent
Definition: GenABIO.cc:224
std::map< DetId, double > theFillDetMap2_
Definition: MinBias.h:62
edm::EDGetTokenT< HBHERecHitCollection > hbheToken_
Definition: MinBias.h:46
std::map< DetId, double > theFillDetMap1_
Definition: MinBias.h:61
Definition: DetId.h:17
std::string hbheLabel_
Definition: MinBias.h:45
std::string hfLabel_
Definition: MinBias.h:45
Log< level::Warning, false > LogWarning
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ beginJob()

void cms::MinBias::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file MinBias.cc.

References depth, eta, compareTotals::fs, ieta, iphi, mom1, mom2, mom3, mom4, mydet, mysubd, myTree_, and phi.

21  {
23  myTree_ = fs->make<TTree>("RecJet", "RecJet Tree");
24  myTree_->Branch("mydet", &mydet, "mydet/I");
25  myTree_->Branch("mysubd", &mysubd, "mysubd/I");
26  myTree_->Branch("depth", &depth, "depth/I");
27  myTree_->Branch("ieta", &ieta, "ieta/I");
28  myTree_->Branch("iphi", &iphi, "iphi/I");
29  myTree_->Branch("eta", &eta, "eta/F");
30  myTree_->Branch("phi", &phi, "phi/F");
31  myTree_->Branch("mom1", &mom1, "mom1/F");
32  myTree_->Branch("mom2", &mom2, "mom2/F");
33  myTree_->Branch("mom3", &mom3, "mom3/F");
34  myTree_->Branch("mom4", &mom4, "mom4/F");
35  }
float mom2
Definition: MinBias.h:57
float mom1
Definition: MinBias.h:57
float mom4
Definition: MinBias.h:57
TTree * myTree_
Definition: MinBias.h:53
int mydet
Definition: MinBias.h:55
int ieta
Definition: MinBias.h:55
int depth
Definition: MinBias.h:55
float eta
Definition: MinBias.h:56
float phi
Definition: MinBias.h:56
float mom3
Definition: MinBias.h:57
int iphi
Definition: MinBias.h:55
int mysubd
Definition: MinBias.h:55

◆ beginRun()

void cms::MinBias::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 37 of file MinBias.cc.

References geo_, edm::EventSetup::get(), CaloGeometry::getValidDetIds(), DetId::Hcal, triggerObjects_cff::id, edm::ESHandle< T >::product(), theFillDetMap0_, theFillDetMap1_, theFillDetMap2_, theFillDetMap3_, and theFillDetMap4_.

37  {
39  iSetup.get<CaloGeometryRecord>().get(pG);
40  geo_ = pG.product();
41  std::vector<DetId> did = geo_->getValidDetIds();
42 
43  for (auto const& id : did) {
44  if ((id).det() == DetId::Hcal) {
45  theFillDetMap0_[id] = 0.;
46  theFillDetMap1_[id] = 0.;
47  theFillDetMap2_[id] = 0.;
48  theFillDetMap3_[id] = 0.;
49  theFillDetMap4_[id] = 0.;
50  }
51  }
52  }
std::map< DetId, double > theFillDetMap4_
Definition: MinBias.h:64
std::map< DetId, double > theFillDetMap3_
Definition: MinBias.h:63
std::map< DetId, double > theFillDetMap0_
Definition: MinBias.h:60
const CaloGeometry * geo_
Definition: MinBias.h:58
T const * product() const
Definition: ESHandle.h:86
std::map< DetId, double > theFillDetMap2_
Definition: MinBias.h:62
std::map< DetId, double > theFillDetMap1_
Definition: MinBias.h:61
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75

◆ endJob()

void cms::MinBias::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file MinBias.cc.

References depth, HcalDetId::depth(), eta, geo_, HcalGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), HcalGeometry::getValidDetIds(), DetId::Hcal, mps_fire::i, triggerObjects_cff::id, ieta, HcalDetId::ieta(), createfilelist::int, iphi, HcalDetId::iphi(), mom1, mom2, mom3, mom4, mydet, mysubd, myTree_, phi, funct::pow(), theFillDetMap0_, theFillDetMap1_, theFillDetMap2_, theFillDetMap3_, and theFillDetMap4_.

54  {
55  const HcalGeometry* hgeo = static_cast<const HcalGeometry*>(geo_->getSubdetectorGeometry(DetId::Hcal, 1));
56  const std::vector<DetId>& did = hgeo->getValidDetIds();
57  int i = 0;
58  for (const auto& id : did) {
59  // if( id.det() == DetId::Hcal ) {
60  GlobalPoint pos = hgeo->getPosition(id);
61  mydet = (int)(id.det());
62  mysubd = (id.subdetId());
63  depth = HcalDetId(id).depth();
64  ieta = HcalDetId(id).ieta();
65  iphi = HcalDetId(id).iphi();
66  phi = pos.phi();
67  eta = pos.eta();
68  if (theFillDetMap0_[id] > 0.) {
72  2. * pow(mom2, 3);
73  mom4 = (theFillDetMap4_[id] - 4. * mom1 * theFillDetMap3_[id] + 6. * pow(mom1, 2) * theFillDetMap2_[id]) /
74  theFillDetMap0_[id] -
75  3. * pow(mom1, 4);
76 
77  } else {
78  mom1 = 0.;
79  mom2 = 0.;
80  mom3 = 0.;
81  mom4 = 0.;
82  }
83  edm::LogWarning("MinBias") << " Detector " << id.rawId() << " mydet " << mydet << " " << mysubd << " " << depth
84  << " " << ieta << " " << iphi << " " << pos.eta() << " " << pos.phi();
85  edm::LogWarning("MinBias") << " Energy " << mom1 << " " << mom2 << std::endl;
86  myTree_->Fill();
87  i++;
88  // }
89  }
90  edm::LogWarning("MinBias") << " The number of CaloDet records " << did.size();
91  edm::LogWarning("MinBias") << " The number of Hcal records " << i << std::endl;
92 
93  /*
94  std::cout << "===== Start writing user histograms =====" << std::endl;
95  hOutputFile->SetCompressionLevel(2);
96  hOutputFile->cd();
97  myTree->Write();
98  hOutputFile->Close() ;
99  std::cout << "===== End writing user histograms =======" << std::endl;
100  */
101  }
float mom2
Definition: MinBias.h:57
float mom1
Definition: MinBias.h:57
float mom4
Definition: MinBias.h:57
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
std::map< DetId, double > theFillDetMap4_
Definition: MinBias.h:64
std::map< DetId, double > theFillDetMap3_
Definition: MinBias.h:63
TTree * myTree_
Definition: MinBias.h:53
std::map< DetId, double > theFillDetMap0_
Definition: MinBias.h:60
int mydet
Definition: MinBias.h:55
int ieta
Definition: MinBias.h:55
const CaloGeometry * geo_
Definition: MinBias.h:58
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::map< DetId, double > theFillDetMap2_
Definition: MinBias.h:62
int depth
Definition: MinBias.h:55
std::map< DetId, double > theFillDetMap1_
Definition: MinBias.h:61
float eta
Definition: MinBias.h:56
float phi
Definition: MinBias.h:56
float mom3
Definition: MinBias.h:57
int iphi
Definition: MinBias.h:55
GlobalPoint getPosition(const DetId &id) const
int mysubd
Definition: MinBias.h:55
Log< level::Warning, false > LogWarning
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

Member Data Documentation

◆ allowMissingInputs_

bool cms::MinBias::allowMissingInputs_
private

Definition at line 50 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ depth

int cms::MinBias::depth
private

◆ eta

float cms::MinBias::eta
private

◆ geo_

const CaloGeometry* cms::MinBias::geo_
private

Definition at line 58 of file MinBias.h.

Referenced by beginRun(), and endJob().

◆ hbheLabel_

std::string cms::MinBias::hbheLabel_
private

Definition at line 45 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ hbheToken_

edm::EDGetTokenT<HBHERecHitCollection> cms::MinBias::hbheToken_
private

Definition at line 46 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ hfLabel_

std::string cms::MinBias::hfLabel_
private

Definition at line 45 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ hfToken_

edm::EDGetTokenT<HFRecHitCollection> cms::MinBias::hfToken_
private

Definition at line 48 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ hoLabel_

std::string cms::MinBias::hoLabel_
private

Definition at line 45 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ hoToken_

edm::EDGetTokenT<HORecHitCollection> cms::MinBias::hoToken_
private

Definition at line 47 of file MinBias.h.

Referenced by analyze(), and MinBias().

◆ ieta

int cms::MinBias::ieta
private

Definition at line 55 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ iphi

int cms::MinBias::iphi
private

Definition at line 55 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mom1

float cms::MinBias::mom1
private

Definition at line 57 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mom2

float cms::MinBias::mom2
private

Definition at line 57 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mom3

float cms::MinBias::mom3
private

Definition at line 57 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mom4

float cms::MinBias::mom4
private

Definition at line 57 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mydet

int cms::MinBias::mydet
private

Definition at line 55 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ mysubd

int cms::MinBias::mysubd
private

Definition at line 55 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ myTree_

TTree* cms::MinBias::myTree_
private

Definition at line 53 of file MinBias.h.

Referenced by beginJob(), and endJob().

◆ occup

float cms::MinBias::occup
private

Definition at line 57 of file MinBias.h.

◆ phi

float cms::MinBias::phi
private

◆ theFillDetMap0_

std::map<DetId, double> cms::MinBias::theFillDetMap0_
private

Definition at line 60 of file MinBias.h.

Referenced by analyze(), beginRun(), and endJob().

◆ theFillDetMap1_

std::map<DetId, double> cms::MinBias::theFillDetMap1_
private

Definition at line 61 of file MinBias.h.

Referenced by analyze(), beginRun(), and endJob().

◆ theFillDetMap2_

std::map<DetId, double> cms::MinBias::theFillDetMap2_
private

Definition at line 62 of file MinBias.h.

Referenced by analyze(), beginRun(), and endJob().

◆ theFillDetMap3_

std::map<DetId, double> cms::MinBias::theFillDetMap3_
private

Definition at line 63 of file MinBias.h.

Referenced by analyze(), beginRun(), and endJob().

◆ theFillDetMap4_

std::map<DetId, double> cms::MinBias::theFillDetMap4_
private

Definition at line 64 of file MinBias.h.

Referenced by analyze(), beginRun(), and endJob().