120 edm::LogError(
"SectorBuilder") <<
"TrackerTreeFile not found";
123 TTree* tkTree(
nullptr);
124 tkTreeFile->GetObject(
"TrackerTreeGenerator/TrackerTree/TrackerTree", tkTree);
128 edm::LogError(
"SectorBuilder") <<
"TrackerTree not found in file";
132 unsigned int rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999), blade(999),
133 panel(999), outerInner(999), module(999),
nStrips(999);
134 bool isDoubleSide(
false), isRPhi(
false), isStereo(
false);
135 int uDirection(999), vDirection(999), wDirection(999);
136 float posR(999.
F), posPhi(999.
F), posEta(999.
F),
posX(999.
F),
posY(999.
F), posZ(999.
F);
138 tkTree->SetBranchAddress(
"RawId", &rawId);
139 tkTree->SetBranchAddress(
"SubdetId", &subdetId);
140 tkTree->SetBranchAddress(
"Layer", &layer);
141 tkTree->SetBranchAddress(
"Side", &side);
142 tkTree->SetBranchAddress(
"Half", &half);
143 tkTree->SetBranchAddress(
"Rod", &rod);
144 tkTree->SetBranchAddress(
"Ring", &
ring);
145 tkTree->SetBranchAddress(
"Petal", &petal);
146 tkTree->SetBranchAddress(
"Blade", &blade);
147 tkTree->SetBranchAddress(
"Panel", &panel);
148 tkTree->SetBranchAddress(
"OuterInner", &outerInner);
149 tkTree->SetBranchAddress(
"Module", &module);
150 tkTree->SetBranchAddress(
"NStrips", &
nStrips);
151 tkTree->SetBranchAddress(
"IsDoubleSide", &isDoubleSide);
152 tkTree->SetBranchAddress(
"IsRPhi", &isRPhi);
153 tkTree->SetBranchAddress(
"IsStereo", &isStereo);
154 tkTree->SetBranchAddress(
"UDirection", &uDirection);
155 tkTree->SetBranchAddress(
"VDirection", &vDirection);
156 tkTree->SetBranchAddress(
"WDirection", &wDirection);
157 tkTree->SetBranchAddress(
"PosR", &posR);
158 tkTree->SetBranchAddress(
"PosPhi", &posPhi);
159 tkTree->SetBranchAddress(
"PosEta", &posEta);
160 tkTree->SetBranchAddress(
"PosX", &
posX);
161 tkTree->SetBranchAddress(
"PosY", &
posY);
162 tkTree->SetBranchAddress(
"PosZ", &posZ);
164 int nModules(tkTree->GetEntries());
168 unsigned int sectorCounter(0);
169 std::vector<edm::ParameterSet> v_sectorDef(
sectors_);
170 edm::LogInfo(
"SectorBuilder") <<
"There are " << v_sectorDef.size() <<
" Sectors defined";
172 for (
auto const& parSet : v_sectorDef) {
175 std::vector<unsigned int> v_rawId(parSet.getParameter<std::vector<unsigned int>>(
"rawId")),
176 v_subdetId(parSet.getParameter<std::vector<unsigned int>>(
"subdetId")),
177 v_layer(parSet.getParameter<std::vector<unsigned int>>(
"layer")),
178 v_side(parSet.getParameter<std::vector<unsigned int>>(
"side")),
179 v_half(parSet.getParameter<std::vector<unsigned int>>(
"half")),
180 v_rod(parSet.getParameter<std::vector<unsigned int>>(
"rod")),
181 v_ring(parSet.getParameter<std::vector<unsigned int>>(
"ring")),
182 v_petal(parSet.getParameter<std::vector<unsigned int>>(
"petal")),
183 v_blade(parSet.getParameter<std::vector<unsigned int>>(
"blade")),
184 v_panel(parSet.getParameter<std::vector<unsigned int>>(
"panel")),
185 v_outerInner(parSet.getParameter<std::vector<unsigned int>>(
"outerInner")),
186 v_module(parSet.getParameter<std::vector<unsigned int>>(
"module")),
187 v_nStrips(parSet.getParameter<std::vector<unsigned int>>(
"nStrips")),
188 v_isDoubleSide(parSet.getParameter<std::vector<unsigned int>>(
"isDoubleSide")),
189 v_isRPhi(parSet.getParameter<std::vector<unsigned int>>(
"isRPhi")),
190 v_isStereo(parSet.getParameter<std::vector<unsigned int>>(
"isStereo"));
191 std::vector<int> v_uDirection(parSet.getParameter<std::vector<int>>(
"uDirection")),
192 v_vDirection(parSet.getParameter<std::vector<int>>(
"vDirection")),
193 v_wDirection(parSet.getParameter<std::vector<int>>(
"wDirection"));
194 std::vector<double> v_posR(parSet.getParameter<std::vector<double>>(
"posR")),
195 v_posPhi(parSet.getParameter<std::vector<double>>(
"posPhi")),
196 v_posEta(parSet.getParameter<std::vector<double>>(
"posEta")),
197 v_posX(parSet.getParameter<std::vector<double>>(
"posX")),
198 v_posY(parSet.getParameter<std::vector<double>>(
"posY")),
199 v_posZ(parSet.getParameter<std::vector<double>>(
"posZ"));
211 tkSector.
name = sectorName;
216 for (
int module = 0; module < nModules; ++module) {
217 tkTree->GetEntry(module);
219 if (sectorCounter == 1) {
279 tkSector.
v_rawId.push_back(rawId);
280 bool moduleSelected(
false);
281 for (
auto const& i_rawId : allSectors.v_rawId) {
282 if (rawId == i_rawId)
283 moduleSelected =
true;
286 allSectors.v_rawId.push_back(rawId);
292 for (
auto const& i_rawId : tkSector.
v_rawId) {
309 <<
"Incorrect Sector Definition: there are pixel and strip modules within one sector"
310 <<
"\n... sector selection is not applied, sector " << sectorCounter <<
" is not built";
316 edm::LogInfo(
"SectorBuilder") <<
"There are " << tkSector.
v_rawId.size() <<
" Modules in Sector " << sectorCounter;