Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-sim100 Take Vladimir's comments for include statements of CLHEP headers #34842

Merged
merged 2 commits into from Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/plugins/HFPMTHitAnalyzer.cc
Expand Up @@ -203,7 +203,7 @@ void HFPMTHitAnalyzer::beginJob() {
void HFPMTHitAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
++event_no;
if (event_no % 500 == 0)
std::cout << "Event # " << event_no << " processed.\n";
edm::LogVerbatim("HcalSim") << "Event # " << event_no << " processed.";

std::vector<PCaloHit> caloHits;
edm::Handle<edm::PCaloHitContainer> hitsHcal;
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/plugins/HOSimHitStudy.cc
Expand Up @@ -22,8 +22,8 @@
#include "SimG4CMS/Calo/interface/CaloHitID.h"
#include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"

#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include <CLHEP/Units/GlobalPhysicalConstants.h>
#include <CLHEP/Units/GlobalSystemOfUnits.h>

#include <TH1F.h>
#include <TProfile.h>
Expand Down
7 changes: 4 additions & 3 deletions SimG4CMS/Calo/plugins/HcalTestAnalysis.cc
Expand Up @@ -30,9 +30,10 @@
#include "G4Track.hh"
#include "G4VProcess.hh"
#include "G4HCofThisEvent.hh"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "Randomize.hh"

#include <CLHEP/Random/Randomize.h>
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

#include <cmath>
#include <iomanip>
Expand Down
10 changes: 5 additions & 5 deletions SimG4CMS/Forward/plugins/BscTest.cc
Expand Up @@ -45,11 +45,11 @@
#include "G4ProcessManager.hh"
#include "G4VTouchable.hh"

#include "CLHEP/Vector/ThreeVector.h"
#include "CLHEP/Vector/LorentzVector.h"
#include "CLHEP/Random/Randomize.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include <CLHEP/Vector/ThreeVector.h>
#include <CLHEP/Vector/LorentzVector.h>
#include <CLHEP/Random/Randomize.h>
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

// ----------------------------------------------------------------
// Includes needed for Root ntupling
Expand Down
7 changes: 4 additions & 3 deletions SimG4CMS/Forward/plugins/CastorTestAnalysis.cc
Expand Up @@ -34,9 +34,10 @@
#include "G4VProcess.hh"
#include "G4HCofThisEvent.hh"
#include "G4UserEventAction.hh"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Random/Randomize.h"

#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>
#include <CLHEP/Random/Randomize.h>

#include "TROOT.h"
#include "TFile.h"
Expand Down
7 changes: 4 additions & 3 deletions SimG4CMS/Forward/plugins/DoCastorAnalysis.cc
Expand Up @@ -35,9 +35,10 @@
#include "G4VProcess.hh"
#include "G4HCofThisEvent.hh"
#include "G4UserEventAction.hh"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Random/Randomize.h"

#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>
#include <CLHEP/Random/Randomize.h>

#include "TROOT.h"
#include "TFile.h"
Expand Down
5 changes: 3 additions & 2 deletions SimG4CMS/Forward/plugins/SimG4FluxProducer.cc
Expand Up @@ -17,8 +17,9 @@
#include "G4Track.hh"
#include "G4TouchableHistory.hh"
#include "G4TransportationManager.hh"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"

#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

#include <cmath>
#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Forward/plugins/TotemTestGem.cc
Expand Up @@ -40,8 +40,8 @@
#include "G4Step.hh"
#include "G4HCofThisEvent.hh"

#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

class TotemTestGem : public SimProducer, public Observer<const BeginOfEvent*>, public Observer<const EndOfEvent*> {
public:
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Forward/plugins/ZdcTestAnalysis.cc
Expand Up @@ -29,9 +29,9 @@
#include "G4HCofThisEvent.hh"
#include "G4UserEventAction.hh"

#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Random/Randomize.h"
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>
#include <CLHEP/Random/Randomize.h>

#include "TROOT.h"
#include "TH1.h"
Expand Down
63 changes: 32 additions & 31 deletions SimG4CMS/HGCalTestBeam/plugins/HGCalTimingAnalyzer.cc
@@ -1,8 +1,7 @@
// system include files
#include <fstream>
#include <iostream>
#include <sstream>
#include <map>
#include <memory>
#include <string>
#include <vector>

Expand All @@ -17,6 +16,7 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
Expand Down Expand Up @@ -92,31 +92,32 @@ HGCalTimingAnalyzer::HGCalTimingAnalyzer(const edm::ParameterSet& iConfig)
if (!groupHits_)
timeUnit_ = 0.000001;
#ifdef EDM_ML_DEBUG
std::cout << "HGCalTimingAnalyzer:: Group Hits " << groupHits_ << " in " << timeUnit_ << " IdBeam " << idBeams_.size()
<< ":";
std::ostringstream st1;
st1 << "HGCalTimingAnalyzer:: Group Hits " << groupHits_ << " in " << timeUnit_ << " IdBeam " << idBeams_.size()
<< ":";
for (const auto& id : idBeams_)
std::cout << " " << id;
std::cout << std::endl;
st1 << " " << id;
edm::LogVerbatim("HGCSim") << st1.str();
#endif
if (idBeams_.empty())
idBeams_.push_back(1001);

edm::InputTag tmp0 = iConfig.getParameter<edm::InputTag>("GeneratorSrc");
tok_hepMC_ = consumes<edm::HepMCProduct>(tmp0);
#ifdef EDM_ML_DEBUG
std::cout << "HGCalTimingAnalyzer:: GeneratorSource = " << tmp0 << std::endl;
edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: GeneratorSource = " << tmp0;
#endif
tok_simTk_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
tok_simVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
std::string tmp1 = iConfig.getParameter<std::string>("CaloHitSrcEE");
tok_hitsEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", tmp1));
#ifdef EDM_ML_DEBUG
std::cout << "HGCalTimingAnalyzer:: Detector " << detectorEE_ << " with tags " << tmp1 << std::endl;
edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: Detector " << detectorEE_ << " with tags " << tmp1;
#endif
tmp1 = iConfig.getParameter<std::string>("CaloHitSrcBeam");
tok_hitsBeam_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", tmp1));
#ifdef EDM_ML_DEBUG
std::cout << "HGCalTimingAnalyzer:: Detector " << detectorBeam_ << " with tags " << tmp1 << std::endl;
edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer:: Detector " << detectorBeam_ << " with tags " << tmp1;
#endif
}

Expand Down Expand Up @@ -158,8 +159,8 @@ void HGCalTimingAnalyzer::beginRun(const edm::Run&, const edm::EventSetup& iSetu
hgcons_ = &iSetup.getData(tokDDD_);

#ifdef EDM_ML_DEBUG
std::cout << "HGCalTimingAnalyzer::" << detectorEE_ << " defined with " << hgcons_->layers(false) << " layers"
<< std::endl;
edm::LogVerbatim("HGCSim") << "HGCalTimingAnalyzer::" << detectorEE_ << " defined with " << hgcons_->layers(false)
<< " layers";
#endif
}

Expand All @@ -175,8 +176,8 @@ void HGCalTimingAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetu
unsigned int k(0);
for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
++p, ++k) {
std::cout << "Particle[" << k << "] with p " << (*p)->momentum().rho() << " theta " << (*p)->momentum().theta()
<< " phi " << (*p)->momentum().phi() << std::endl;
edm::LogVerbatim("HGCSim") << "Particle[" << k << "] with p " << (*p)->momentum().rho() << " theta "
<< (*p)->momentum().theta() << " phi " << (*p)->momentum().phi();
}
}
#endif
Expand All @@ -200,30 +201,30 @@ void HGCalTimingAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetu
iEvent.getByToken(tok_hitsEE_, theCaloHitContainers);
if (theCaloHitContainers.isValid()) {
#ifdef EDM_ML_DEBUG
std::cout << "PcalohitContainer for " << detectorEE_ << " has " << theCaloHitContainers->size() << " hits"
<< std::endl;
edm::LogVerbatim("HGCSim") << "PcalohitContainer for " << detectorEE_ << " has " << theCaloHitContainers->size()
<< " hits";
#endif
caloHits.clear();
caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
analyzeSimHits(0, caloHits);
} else {
#ifdef EDM_ML_DEBUG
std::cout << "PCaloHitContainer does not exist for " << detectorEE_ << " !!!" << std::endl;
edm::LogVerbatim("HGCSim") << "PCaloHitContainer does not exist for " << detectorEE_ << " !!!";
#endif
}

iEvent.getByToken(tok_hitsBeam_, theCaloHitContainers);
if (theCaloHitContainers.isValid()) {
#ifdef EDM_ML_DEBUG
std::cout << "PcalohitContainer for " << detectorBeam_ << " has " << theCaloHitContainers->size() << " hits"
<< std::endl;
edm::LogVerbatim("HGCSim") << "PcalohitContainer for " << detectorBeam_ << " has " << theCaloHitContainers->size()
<< " hits";
#endif
caloHits.clear();
caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
analyzeSimHits(1, caloHits);
} else {
#ifdef EDM_ML_DEBUG
std::cout << "PCaloHitContainer does not exist for " << detectorBeam_ << " !!!" << std::endl;
edm::LogVerbatim("HGCSim") << "PCaloHitContainer does not exist for " << detectorBeam_ << " !!!";
#endif
}
if (doTree_)
Expand All @@ -246,16 +247,16 @@ void HGCalTimingAnalyzer::analyzeSimHits(int type, std::vector<PCaloHit> const&
id = HGCalDetId((ForwardSubdetector)(subdet), zside, recoLayerCell.second, subsector, sector, recoLayerCell.first)
.rawId();
#ifdef EDM_ML_DEBUG
std::cout << "SimHit:Hit[" << i << "] Id " << subdet << ":" << zside << ":" << layer << ":" << sector << ":"
<< subsector << ":" << recoLayerCell.first << ":" << recoLayerCell.second << " Energy " << energy
<< " Time " << time << std::endl;
edm::LogVerbatim("HGCSim") << "SimHit:Hit[" << i << "] Id " << subdet << ":" << zside << ":" << layer << ":"
<< sector << ":" << subsector << ":" << recoLayerCell.first << ":"
<< recoLayerCell.second << " Energy " << energy << " Time " << time;
#endif
} else {
#ifdef EDM_ML_DEBUG
int subdet, layer, x, y;
HcalTestBeamNumbering::unpackIndex(id, subdet, layer, x, y);
std::cout << "SimHit:Hit[" << i << "] Beam Subdet " << subdet << " Layer " << layer << " x|y " << x << ":" << y
<< " Energy " << energy << " Time " << time << std::endl;
edm::LogVerbatim("HGCSim") << "SimHit:Hit[" << i << "] Beam Subdet " << subdet << " Layer " << layer << " x|y "
<< x << ":" << y << " Energy " << energy << " Time " << time;
#endif
}
uint64_t tid = (uint64_t)((time + 50.0) / timeUnit_);
Expand All @@ -273,8 +274,8 @@ void HGCalTimingAnalyzer::analyzeSimHits(int type, std::vector<PCaloHit> const&
}

#ifdef EDM_ML_DEBUG
std::cout << "analyzeSimHits: Finds " << map_hits.size() << " hits "
<< " from the Hit Vector of size " << hits.size() << " for type " << type << std::endl;
edm::LogVerbatim("HGCSim") << "analyzeSimHits: Finds " << map_hits.size() << " hits "
<< " from the Hit Vector of size " << hits.size() << " for type " << type;
#endif
for (const auto& itr : map_hits) {
uint32_t id = (itr.first).first;
Expand All @@ -290,7 +291,7 @@ void HGCalTimingAnalyzer::analyzeSimHits(int type, std::vector<PCaloHit> const&
simHitCellTmBeam_.push_back(time);
}
#ifdef EDM_ML_DEBUG
std::cout << "SimHit::ID: " << std::hex << id << std::dec << " T: " << time << " E: " << energy << std::endl;
edm::LogVerbatim("HGCSim") << "SimHit::ID: " << std::hex << id << std::dec << " T: " << time << " E: " << energy;
#endif
}
}
Expand All @@ -301,9 +302,9 @@ void HGCalTimingAnalyzer::analyzeSimTracks(edm::Handle<edm::SimTrackContainer> c
int vertIndex(-1);
for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
#ifdef EDM_ML_DEBUG
std::cout << "Track " << simTrkItr->trackId() << " Vertex " << simTrkItr->vertIndex() << " Type "
<< simTrkItr->type() << " Charge " << simTrkItr->charge() << " momentum " << simTrkItr->momentum() << " "
<< simTrkItr->momentum().P() << std::endl;
edm::LogVerbatim("HGCSim") << "Track " << simTrkItr->trackId() << " Vertex " << simTrkItr->vertIndex() << " Type "
<< simTrkItr->type() << " Charge " << simTrkItr->charge() << " momentum "
<< simTrkItr->momentum() << " " << simTrkItr->momentum().P();
#endif
if (vertIndex == -1) {
vertIndex = simTrkItr->vertIndex();
Expand All @@ -315,7 +316,7 @@ void HGCalTimingAnalyzer::analyzeSimTracks(edm::Handle<edm::SimTrackContainer> c
for (int iv = 0; iv < vertIndex; iv++)
simVtxItr++;
#ifdef EDM_ML_DEBUG
std::cout << "Vertex " << vertIndex << " position " << simVtxItr->position() << std::endl;
edm::LogVerbatim("HGCSim") << "Vertex " << vertIndex << " position " << simVtxItr->position();
#endif
xBeam_ = simVtxItr->position().X();
yBeam_ = simVtxItr->position().Y();
Expand Down
16 changes: 8 additions & 8 deletions SimG4CMS/HcalTestBeam/plugins/HcalTB02Analysis.cc
Expand Up @@ -47,10 +47,10 @@
#include "G4ThreeVector.hh"
#include "G4VProcess.hh"

#include "CLHEP/Random/RandGaussQ.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "Randomize.hh"
#include <CLHEP/Random/RandGaussQ.h>
#include <CLHEP/Random/Randomize.h>
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

//#define EDM_ML_DEBUG

Expand Down Expand Up @@ -385,13 +385,13 @@ void HcalTB02Analysis::update(const EndOfEvent* evt) {

int iEvt = (*evt)()->GetEventID();
if (iEvt < 10)
std::cout << " Event " << iEvt << std::endl;
edm::LogVerbatim("HcalTBSim") << " Event " << iEvt;
else if ((iEvt < 100) && (iEvt % 10 == 0))
std::cout << " Event " << iEvt << std::endl;
edm::LogVerbatim("HcalTBSim") << " Event " << iEvt;
else if ((iEvt < 1000) && (iEvt % 100 == 0))
std::cout << " Event " << iEvt << std::endl;
edm::LogVerbatim("HcalTBSim") << " Event " << iEvt;
else if ((iEvt < 10000) && (iEvt % 1000 == 0))
std::cout << " Event " << iEvt << std::endl;
edm::LogVerbatim("HcalTBSim") << " Event " << iEvt;
}

void HcalTB02Analysis::fillEvent(HcalTB02HistoClass& product) {
Expand Down
10 changes: 6 additions & 4 deletions SimG4CMS/HcalTestBeam/plugins/HcalTB04Analysis.cc
Expand Up @@ -56,10 +56,12 @@
#include "G4ThreeVector.hh"
#include "G4VProcess.hh"
#include "G4HCofThisEvent.hh"
#include "CLHEP/Random/RandGaussQ.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "Randomize.hh"

#include <CLHEP/Random/RandGaussQ.h>
#include <CLHEP/Random/Randomize.h>
#include <CLHEP/Units/GlobalSystemOfUnits.h>
#include <CLHEP/Units/GlobalPhysicalConstants.h>

#include <cstdint>

//#define EDM_ML_DEBUG
Expand Down