CMS 3D CMS Logo

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

Classes

struct  RPPlots
 

Public Member Functions

 CTPPSProtonReconstructionValidator (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, 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
 
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

double chiSqCut_
 
std::string outputFile_
 
std::map< unsigned int, RPPlotsrp_plots_
 
edm::EDGetTokenT< reco::ForwardProtonCollectiontokenRecoProtons_
 

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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

Definition at line 32 of file CTPPSProtonReconstructionValidator.cc.

Constructor & Destructor Documentation

CTPPSProtonReconstructionValidator::CTPPSProtonReconstructionValidator ( const edm::ParameterSet iConfig)
explicit

Definition at line 71 of file CTPPSProtonReconstructionValidator.cc.

72  : tokenRecoProtons_(consumes<reco::ForwardProtonCollection>(iConfig.getParameter<edm::InputTag>("tagRecoProtons"))),
73  chiSqCut_(iConfig.getParameter<double>("chiSqCut")),
74  outputFile_(iConfig.getParameter<string>("outputFile")) {}
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtons_

Member Function Documentation

void CTPPSProtonReconstructionValidator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 78 of file CTPPSProtonReconstructionValidator.cc.

References CTPPSDetId::arm(), chiSqCut_, alignCSCRings::de_x, alignCSCRings::de_y, edm::EventSetup::get(), edm::Event::getByToken(), rp_plots_, tokenRecoProtons_, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

78  {
79  // get conditions
81  iSetup.get<CTPPSInterpolatedOpticsRcd>().get(hOpticalFunctions);
82 
83  // stop if conditions invalid
84  if (hOpticalFunctions->empty())
85  return;
86 
87  // get input
89  iEvent.getByToken(tokenRecoProtons_, hRecoProtons);
90 
91  // process tracks
92  for (const auto& pr : *hRecoProtons) {
93  if (!pr.validFit())
94  continue;
95 
96  if (pr.chi2() > chiSqCut_)
97  continue;
98 
99  for (const auto& tr : pr.contributingLocalTracks()) {
100  CTPPSDetId rpId(tr->rpId());
101  unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
102 
103  auto it = hOpticalFunctions->find(rpId);
104 
105  LHCInterpolatedOpticalFunctionsSet::Kinematics k_in_beam = {0., 0., 0., 0., 0.};
107  it->second.transport(k_in_beam, k_out_beam);
108 
110  -pr.vx(), -pr.thetaX(), pr.vy(), pr.thetaY(), pr.xi()}; // conversions: CMS --> LHC convention
112  it->second.transport(k_in, k_out);
113 
114  const double de_x = (k_out.x - k_out_beam.x) * 10. - tr->x(); // conversions: cm --> mm
115  const double de_y = (k_out.y - k_out_beam.y) * 10. - tr->y(); // conversions: cm --> mm
116 
117  rp_plots_[rpDecId].fill(de_x, de_y);
118  }
119  }
120 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtons_
uint32_t arm() const
Definition: CTPPSDetId.h:51
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
T get() const
Definition: EventSetup.h:73
void CTPPSProtonReconstructionValidator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 124 of file CTPPSProtonReconstructionValidator.cc.

References DEFINE_FWK_MODULE, outputFile_, AlCaHLTBitMon_ParallelJobs::p, and rp_plots_.

124  {
125  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
126 
127  for (const auto& p : rp_plots_) {
128  gDirectory = f_out->mkdir(Form("%u", p.first));
129  p.second.write();
130  }
131 }

Member Data Documentation

double CTPPSProtonReconstructionValidator::chiSqCut_
private

Definition at line 41 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().

std::string CTPPSProtonReconstructionValidator::outputFile_
private

Definition at line 42 of file CTPPSProtonReconstructionValidator.cc.

Referenced by endJob().

std::map<unsigned int, RPPlots> CTPPSProtonReconstructionValidator::rp_plots_
private

Definition at line 61 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze(), and endJob().

edm::EDGetTokenT<reco::ForwardProtonCollection> CTPPSProtonReconstructionValidator::tokenRecoProtons_
private

Definition at line 40 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().