CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CTPPSProtonReconstructionDiffPlotter Class Reference
Inheritance diagram for CTPPSProtonReconstructionDiffPlotter:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CTPPSProtonReconstructionDiffPlotter (const edm::ParameterSet &)
 
 ~CTPPSProtonReconstructionDiffPlotter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 

Private Attributes

std::unique_ptr< TH1D > h_de_th_x
 
std::unique_ptr< TH1D > h_de_th_y
 
std::unique_ptr< TH1D > h_de_vtx_y
 
std::unique_ptr< TH1D > h_de_xi
 
std::string outputFile_
 
edm::EDGetTokenT< reco::ForwardProtonCollectiontokenRecoProtonsRef_
 
edm::EDGetTokenT< reco::ForwardProtonCollectiontokenRecoProtonsTest_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 32 of file CTPPSProtonReconstructionDiffPlotter.cc.

Constructor & Destructor Documentation

◆ CTPPSProtonReconstructionDiffPlotter()

CTPPSProtonReconstructionDiffPlotter::CTPPSProtonReconstructionDiffPlotter ( const edm::ParameterSet ps)
explicit

Definition at line 57 of file CTPPSProtonReconstructionDiffPlotter.cc.

59  : tokenRecoProtonsRef_(consumes<reco::ForwardProtonCollection>(ps.getParameter<InputTag>("tagRecoProtonsRef"))),
60  tokenRecoProtonsTest_(consumes<reco::ForwardProtonCollection>(ps.getParameter<InputTag>("tagRecoProtonsTest"))),
61 
62  outputFile_(ps.getParameter<string>("outputFile")),
63 
64  h_de_xi(new TH1D("", ";#Delta#xi", 200, -0.01, +0.01)),
65  h_de_th_x(new TH1D("", ";#Delta#theta_{x}", 200, -100E-6, +100E-6)),
66  h_de_th_y(new TH1D("", ";#Delta#theta_{y}", 200, -100E-6, +100E-6)),

◆ ~CTPPSProtonReconstructionDiffPlotter()

CTPPSProtonReconstructionDiffPlotter::~CTPPSProtonReconstructionDiffPlotter ( )
inlineoverride

Definition at line 37 of file CTPPSProtonReconstructionDiffPlotter.cc.

38 :
39  void analyze(const edm::Event &, const edm::EventSetup &) override;

Member Function Documentation

◆ analyze()

void CTPPSProtonReconstructionDiffPlotter::analyze ( const edm::Event event,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 70 of file CTPPSProtonReconstructionDiffPlotter.cc.

71  {
72  // get input
74  event.getByToken(tokenRecoProtonsRef_, hRecoProtonsRef);
75 
77  event.getByToken(tokenRecoProtonsTest_, hRecoProtonsTest);
78 
79  if (hRecoProtonsRef->size() != hRecoProtonsTest->size()) {
80  edm::LogWarning("CTPPSProtonReconstructionDiffPlotter::analyze")
81  << "Different number of Ref and Test protons. Skipping event.";
82  return;
83  }
84 
85  for (unsigned int i = 0; i < hRecoProtonsRef->size(); ++i) {
86  const auto &pr_ref = hRecoProtonsRef->at(i);
87  const auto &pr_test = hRecoProtonsTest->at(i);
88 
89  if (!pr_ref.validFit() || !pr_test.validFit())
90  continue;
91 
92  h_de_xi->Fill(pr_test.xi() - pr_ref.xi());
93  h_de_th_x->Fill(pr_test.thetaX() - pr_ref.thetaX());
94  h_de_th_y->Fill(pr_test.thetaY() - pr_ref.thetaY());
95  h_de_vtx_y->Fill(pr_test.vy() - pr_ref.vy());
96  }

References h_de_th_x, h_de_th_y, h_de_vtx_y, h_de_xi, mps_fire::i, tokenRecoProtonsRef_, and tokenRecoProtonsTest_.

◆ endJob()

void CTPPSProtonReconstructionDiffPlotter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 100 of file CTPPSProtonReconstructionDiffPlotter.cc.

101  {
102  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
103 
104  h_de_xi->Write("h_de_xi");
105  h_de_th_x->Write("h_de_th_x");
106  h_de_th_y->Write("h_de_th_y");
107  h_de_vtx_y->Write("h_de_vtx_y");

References h_de_th_x, h_de_th_y, h_de_vtx_y, h_de_xi, and outputFile_.

Member Data Documentation

◆ h_de_th_x

std::unique_ptr<TH1D> CTPPSProtonReconstructionDiffPlotter::h_de_th_x
private

Definition at line 49 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_de_th_y

std::unique_ptr<TH1D> CTPPSProtonReconstructionDiffPlotter::h_de_th_y
private

Definition at line 49 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_de_vtx_y

std::unique_ptr<TH1D> CTPPSProtonReconstructionDiffPlotter::h_de_vtx_y
private

Definition at line 49 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze(), and endJob().

◆ h_de_xi

std::unique_ptr<TH1D> CTPPSProtonReconstructionDiffPlotter::h_de_xi
private

Definition at line 49 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze(), and endJob().

◆ outputFile_

std::string CTPPSProtonReconstructionDiffPlotter::outputFile_
private

Definition at line 47 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by endJob().

◆ tokenRecoProtonsRef_

edm::EDGetTokenT<reco::ForwardProtonCollection> CTPPSProtonReconstructionDiffPlotter::tokenRecoProtonsRef_
private

Definition at line 44 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze().

◆ tokenRecoProtonsTest_

edm::EDGetTokenT<reco::ForwardProtonCollection> CTPPSProtonReconstructionDiffPlotter::tokenRecoProtonsTest_
private

Definition at line 45 of file CTPPSProtonReconstructionDiffPlotter.cc.

Referenced by analyze().

mps_fire.i
i
Definition: mps_fire.py:428
CTPPSProtonReconstructionDiffPlotter::h_de_th_x
std::unique_ptr< TH1D > h_de_th_x
Definition: CTPPSProtonReconstructionDiffPlotter.cc:49
CTPPSProtonReconstructionDiffPlotter::outputFile_
std::string outputFile_
Definition: CTPPSProtonReconstructionDiffPlotter.cc:47
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CTPPSProtonReconstructionDiffPlotter::tokenRecoProtonsRef_
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsRef_
Definition: CTPPSProtonReconstructionDiffPlotter.cc:44
CTPPSProtonReconstructionDiffPlotter::h_de_xi
std::unique_ptr< TH1D > h_de_xi
Definition: CTPPSProtonReconstructionDiffPlotter.cc:49
CTPPSProtonReconstructionDiffPlotter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CTPPSProtonReconstructionDiffPlotter.cc:70
CTPPSProtonReconstructionDiffPlotter::tokenRecoProtonsTest_
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsTest_
Definition: CTPPSProtonReconstructionDiffPlotter.cc:45
edm::EventSetup
Definition: EventSetup.h:58
CTPPSProtonReconstructionDiffPlotter::h_de_vtx_y
std::unique_ptr< TH1D > h_de_vtx_y
Definition: CTPPSProtonReconstructionDiffPlotter.cc:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
CTPPSProtonReconstructionDiffPlotter::h_de_th_y
std::unique_ptr< TH1D > h_de_th_y
Definition: CTPPSProtonReconstructionDiffPlotter.cc:49