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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
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

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
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>
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)
 
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 31 of file CTPPSProtonReconstructionValidator.cc.

Constructor & Destructor Documentation

◆ CTPPSProtonReconstructionValidator()

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

Definition at line 70 of file CTPPSProtonReconstructionValidator.cc.

72  : tokenRecoProtons_(consumes<reco::ForwardProtonCollection>(iConfig.getParameter<edm::InputTag>("tagRecoProtons"))),
73  chiSqCut_(iConfig.getParameter<double>("chiSqCut")),

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 77 of file CTPPSProtonReconstructionValidator.cc.

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  // skip other than tracking RPs
104  if (rpId.subdetId() != CTPPSDetId::sdTrackingStrip && rpId.subdetId() != CTPPSDetId::sdTrackingPixel)
105  continue;
106 
107  // try to get optics for the RP
108  auto it = hOpticalFunctions->find(rpId);
109  if (it == hOpticalFunctions->end())
110  continue;
111 
112  // do propagation
113  LHCInterpolatedOpticalFunctionsSet::Kinematics k_in_beam = {0., 0., 0., 0., 0.};
115  it->second.transport(k_in_beam, k_out_beam);
116 
118  -pr.vx(), -pr.thetaX(), pr.vy(), pr.thetaY(), pr.xi()}; // conversions: CMS --> LHC convention
120  it->second.transport(k_in, k_out);
121 
122  // fill plots
123  const double de_x = (k_out.x - k_out_beam.x) * 10. - tr->x(); // conversions: cm --> mm
124  const double de_y = (k_out.y - k_out_beam.y) * 10. - tr->y(); // conversions: cm --> mm
125 
126  rp_plots_[rpDecId].fill(de_x, de_y);
127  }
128  }

References chiSqCut_, alignCSCRings::de_x, alignCSCRings::de_y, edm::EventSetup::get(), get, iEvent, rp_plots_, year_2016_postTS2_cff::rpId, CTPPSDetId::sdTrackingPixel, CTPPSDetId::sdTrackingStrip, tokenRecoProtons_, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

◆ endJob()

void CTPPSProtonReconstructionValidator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 132 of file CTPPSProtonReconstructionValidator.cc.

133  {
134  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
135 
136  for (const auto& p : rp_plots_) {
137  gDirectory = f_out->mkdir(Form("%u", p.first));
138  p.second.write();
139  }

References outputFile_, AlCaHLTBitMon_ParallelJobs::p, and rp_plots_.

Member Data Documentation

◆ chiSqCut_

double CTPPSProtonReconstructionValidator::chiSqCut_
private

Definition at line 42 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().

◆ outputFile_

std::string CTPPSProtonReconstructionValidator::outputFile_
private

Definition at line 43 of file CTPPSProtonReconstructionValidator.cc.

Referenced by endJob().

◆ rp_plots_

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

Definition at line 62 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze(), and endJob().

◆ tokenRecoProtons_

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

Definition at line 41 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().

LHCInterpolatedOpticalFunctionsSet::Kinematics
proton kinematics description
Definition: LHCInterpolatedOpticalFunctionsSet.h:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSDetId::sdTrackingStrip
Definition: CTPPSDetId.h:44
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CTPPSProtonReconstructionValidator::tokenRecoProtons_
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtons_
Definition: CTPPSProtonReconstructionValidator.cc:41
LHCInterpolatedOpticalFunctionsSet::Kinematics::y
double y
Definition: LHCInterpolatedOpticalFunctionsSet.h:31
CTPPSProtonReconstructionValidator::rp_plots_
std::map< unsigned int, RPPlots > rp_plots_
Definition: CTPPSProtonReconstructionValidator.cc:62
edm::ESHandle< LHCInterpolatedOpticalFunctionsSetCollection >
LHCInterpolatedOpticalFunctionsSet::Kinematics::x
double x
Definition: LHCInterpolatedOpticalFunctionsSet.h:29
CTPPSDetId::sdTrackingPixel
Definition: CTPPSDetId.h:44
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:38
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
alignCSCRings.de_y
de_y
Definition: alignCSCRings.py:86
get
#define get
CTPPSProtonReconstructionValidator::chiSqCut_
double chiSqCut_
Definition: CTPPSProtonReconstructionValidator.cc:42
CTPPSProtonReconstructionValidator::outputFile_
std::string outputFile_
Definition: CTPPSProtonReconstructionValidator.cc:43
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
alignCSCRings.de_x
de_x
Definition: alignCSCRings.py:85
edm::InputTag
Definition: InputTag.h:15
CTPPSInterpolatedOpticsRcd
Definition: CTPPSInterpolatedOpticsRcd.h:13