72 std::vector<int> multiRP_arm;
75 std::vector<float> trackX, trackY, trackTime, trackTimeUnc;
76 std::vector<int> multiRPProtonIdx,
decRPId, rpType;
77 std::vector<int> singleRPProtonIdx, singleRP_protonRPId;
82 const auto &num_proton = hRecoProtonsSingleRP->size();
83 singleRP_protonRPId.reserve(num_proton);
85 for (
const auto &proton : *hRecoProtonsSingleRP) {
86 CTPPSDetId rpId((*proton.contributingLocalTracks().begin())->getRPId());
87 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
88 singleRP_protonRPId.push_back(rpDecId);
94 const auto &num_proton = hRecoProtonsMultiRP->size();
95 multiRP_arm.reserve(num_proton);
97 for (
const auto &proton : *hRecoProtonsMultiRP) {
98 multiRP_arm.push_back((proton.pz() < 0.) ? 1 : 0);
103 for (
unsigned int tr_idx = 0; tr_idx < ppsTracksLite->size(); ++tr_idx) {
104 const auto &tr = ppsTracksLite->at(tr_idx);
109 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
111 signed int singleRP_idx = -1;
112 for (
unsigned int p_idx = 0; p_idx < hRecoProtonsSingleRP->size(); ++p_idx) {
113 const auto &proton = hRecoProtonsSingleRP->at(p_idx);
115 for (
const auto &ref : proton.contributingLocalTracks()) {
116 if (ref.key() == tr_idx) {
117 singleRP_idx = p_idx;
123 signed int multiRP_idx = -1;
124 for (
unsigned int p_idx = 0; p_idx < hRecoProtonsMultiRP->size(); ++p_idx) {
125 const auto &proton = hRecoProtonsMultiRP->at(p_idx);
127 for (
const auto &ref : proton.contributingLocalTracks()) {
128 if (ref.key() == tr_idx) {
136 singleRPProtonIdx.push_back(singleRP_idx);
137 multiRPProtonIdx.push_back(multiRP_idx);
138 decRPId.push_back(rpDecId);
139 rpType.push_back(
rpId.subdetId());
140 trackX.push_back(tr.getX());
141 trackY.push_back(tr.getY());
142 trackTime.push_back(tr.getTime());
143 trackTimeUnc.push_back(tr.getTimeUnc());
149 for (
unsigned int p_idx = 0; p_idx < hRecoProtonsMultiRP->size(); ++p_idx) {
150 const auto &proton = hRecoProtonsMultiRP->at(p_idx);
151 multiRP_arm.push_back((proton.pz() < 0.) ? 1 : 0);
153 for (
const auto &ref : proton.contributingLocalTracks()) {
154 multiRPProtonIdx.push_back(p_idx);
156 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
157 decRPId.push_back(rpDecId);
158 rpType.push_back(
rpId.subdetId());
159 trackX.push_back(ref->getX());
160 trackY.push_back(ref->getY());
161 trackTime.push_back(ref->getTime());
162 trackTimeUnc.push_back(ref->getTimeUnc());
170 fillermultiArm.insert(hRecoProtonsMultiRP, multiRP_arm.begin(), multiRP_arm.end());
171 fillermultiArm.fill();
176 fillerID.insert(hRecoProtonsSingleRP, singleRP_protonRPId.begin(), singleRP_protonRPId.end());
181 auto ppsTab = std::make_unique<nanoaod::FlatTable>(trackX.size(),
"PPSLocalTrack",
false);
191 ppsTab->setDoc(
"ppsLocalTrack variables");
const edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsMultiRP_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsSingleRP_
Base class for CTPPS detector IDs.
const edm::EDGetTokenT< std::vector< CTPPSLocalTrackLite > > tokenTracksLite_
const bool storeSingleRPProtons_