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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
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
 
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 Member Functions

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

Private Attributes

double chiSqCut_
 
edm::ESGetToken< LHCInterpolatedOpticalFunctionsSetCollection, CTPPSInterpolatedOpticsRcdopticsESToken_
 
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 = 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 31 of file CTPPSProtonReconstructionValidator.cc.

Constructor & Destructor Documentation

◆ CTPPSProtonReconstructionValidator()

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

Definition at line 71 of file CTPPSProtonReconstructionValidator.cc.

73  : tokenRecoProtons_(consumes<reco::ForwardProtonCollection>(iConfig.getParameter<edm::InputTag>("tagRecoProtons"))),
75  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 79 of file CTPPSProtonReconstructionValidator.cc.

80  {
81  // get conditions
82  const auto& opticalFunctions = iSetup.getData(opticsESToken_);
83 
84  // stop if conditions invalid
85  if (opticalFunctions.empty())
86  return;
87 
88  // get input
90  iEvent.getByToken(tokenRecoProtons_, hRecoProtons);
91 
92  // process tracks
93  for (const auto& pr : *hRecoProtons) {
94  if (!pr.validFit())
95  continue;
96 
97  if (pr.chi2() > chiSqCut_)
98  continue;
99 
100  for (const auto& tr : pr.contributingLocalTracks()) {
101  CTPPSDetId rpId(tr->rpId());
102  unsigned int rpDecId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
103 
104  // skip other than tracking RPs
105  if (rpId.subdetId() != CTPPSDetId::sdTrackingStrip && rpId.subdetId() != CTPPSDetId::sdTrackingPixel)
106  continue;
107 
108  // try to get optics for the RP
109  if (opticalFunctions.count(rpId) == 0)
110  continue;
111  const auto& func = opticalFunctions.at(rpId);
112 
113  // do propagation
114  LHCInterpolatedOpticalFunctionsSet::Kinematics k_in_beam = {0., 0., 0., 0., 0.};
116  func.transport(k_in_beam, k_out_beam);
117 
119  -pr.vx(), -pr.thetaX(), pr.vy(), pr.thetaY(), pr.xi()}; // conversions: CMS --> LHC convention
121  func.transport(k_in, k_out);
122 
123  // fill plots
124  const double de_x = (k_out.x - k_out_beam.x) * 10. - tr->x(); // conversions: cm --> mm
125  const double de_y = (k_out.y - k_out_beam.y) * 10. - tr->y(); // conversions: cm --> mm
126 
127  rp_plots_[rpDecId].fill(de_x, de_y);
128  }
129  }

References chiSqCut_, alignCSCRings::de_x, alignCSCRings::de_y, TrackCollections2monitor_cff::func, edm::EventSetup::getData(), iEvent, OpticalFunctionsConfig_cfi::opticalFunctions, opticsESToken_, rp_plots_, profile_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 133 of file CTPPSProtonReconstructionValidator.cc.

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

References outputFile_, AlCaHLTBitMon_ParallelJobs::p, and rp_plots_.

Member Data Documentation

◆ chiSqCut_

double CTPPSProtonReconstructionValidator::chiSqCut_
private

Definition at line 43 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().

◆ opticsESToken_

edm::ESGetToken<LHCInterpolatedOpticalFunctionsSetCollection, CTPPSInterpolatedOpticsRcd> CTPPSProtonReconstructionValidator::opticsESToken_
private

Definition at line 42 of file CTPPSProtonReconstructionValidator.cc.

Referenced by analyze().

◆ outputFile_

std::string CTPPSProtonReconstructionValidator::outputFile_
private

Definition at line 44 of file CTPPSProtonReconstructionValidator.cc.

Referenced by endJob().

◆ rp_plots_

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

Definition at line 63 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
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSDetId::sdTrackingStrip
Definition: CTPPSDetId.h:44
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:63
LHCInterpolatedOpticalFunctionsSet::Kinematics::x
double x
Definition: LHCInterpolatedOpticalFunctionsSet.h:29
CTPPSDetId::sdTrackingPixel
Definition: CTPPSDetId.h:44
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CTPPSProtonReconstructionValidator::opticsESToken_
edm::ESGetToken< LHCInterpolatedOpticalFunctionsSetCollection, CTPPSInterpolatedOpticsRcd > opticsESToken_
Definition: CTPPSProtonReconstructionValidator.cc:42
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:32
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
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
CTPPSProtonReconstructionValidator::chiSqCut_
double chiSqCut_
Definition: CTPPSProtonReconstructionValidator.cc:43
CTPPSProtonReconstructionValidator::outputFile_
std::string outputFile_
Definition: CTPPSProtonReconstructionValidator.cc:44
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
profile_2016_postTS2_cff.rpId
rpId
Definition: profile_2016_postTS2_cff.py:21
alignCSCRings.de_x
de_x
Definition: alignCSCRings.py:85
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
edm::InputTag
Definition: InputTag.h:15
OpticalFunctionsConfig_cfi.opticalFunctions
opticalFunctions
Definition: OpticalFunctionsConfig_cfi.py:16