8 L1SimTrack::L1SimTrack() {
13 L1SimTrack::L1SimTrack(
14 int eventid,
int trackid,
int type,
double pt,
double eta,
double phi,
double vx,
double vy,
double vz) {
28 out <<
"SimTrack: " << eventid_ <<
"\t" << trackid_ <<
"\t" << type_ <<
"\t" << pt_ <<
"\t" << eta_ <<
"\t" << phi_
29 <<
"\t" << vx_ <<
"\t" << vy_ <<
"\t" << vz_ <<
"\t" << endl;
35 out <<
"SimTrack: " << eventid_ <<
"\t" << trackid_ <<
"\t" << type_ <<
"\t" << pt_ <<
"\t" << eta_ <<
"\t" << phi_
36 <<
"\t" << vx_ <<
"\t" << vy_ <<
"\t" << vz_ <<
"\t" << endl;
40 void SLHCEvent::addL1SimTrack(
41 int eventid,
int trackid,
int type,
double pt,
double eta,
double phi,
double vx,
double vy,
double vz) {
45 simtracks_.push_back(simtrack);
48 bool SLHCEvent::addStub(
int layer,
61 if (layer > 999 && layer < 1999 && z < 0.0) {
70 eventid, tps, -1, -1, layer,
ladder, module,
strip, x, y, z, -1.0, -1.0,
pt,
bend, isPSmodule, isFlipped);
72 stubs_.push_back(stub);
76 SLHCEvent::SLHCEvent(istream&
in) {
79 while (
tmp ==
"Map:") {
83 if (
tmp ==
"EndMap") {
86 if (
tmp !=
"Event:") {
89 edm::LogVerbatim(
"Tracklet") <<
"WARNING: fewer events to process than specified!";
100 while (
tmp !=
"SimTrackEnd") {
101 if (!(
tmp ==
"SimTrack:" ||
tmp ==
"SimTrackEnd")) {
102 edm::LogVerbatim(
"Tracklet") <<
"Expected to read 'SimTrack:' or 'SimTrackEnd' but found:" <<
tmp;
120 in >> eventid >> trackid >>
type >> pt_str >> eta_str >> phi_str >> vx_str >> vy_str >> vz_str;
121 pt = strtod(pt_str.c_str(),
nullptr);
122 eta = strtod(eta_str.c_str(),
nullptr);
123 phi = strtod(phi_str.c_str(),
nullptr);
124 vx = strtod(vx_str.c_str(),
nullptr);
125 vy = strtod(vy_str.c_str(),
nullptr);
126 vz = strtod(vz_str.c_str(),
nullptr);
130 simtracks_.push_back(simtrack);
139 double oldz = -1000.0;
143 while (
tmp !=
"StubEnd") {
148 if (!(
tmp ==
"Stub:" ||
tmp ==
"StubEnd")) {
168 in >> layer >>
ladder >> module >>
strip >> eventid >>
pt >>
x >>
y >>
z >>
bend >> isPSmodule >> isFlipped >> ntps;
170 for (
unsigned int itps = 0; itps < ntps; itps++) {
176 if (layer > 999 && layer < 1999 && z < 0.0) {
180 int cbc =
strip / 126;
181 if (layer > 3 && layer == oldlayer &&
ladder == oldladder && module == oldmodule && cbc == oldcbc &&
198 eventid, tps, -1, -1, layer,
ladder, module,
strip, x, y, z, -1.0, -1.0,
pt,
bend, isPSmodule, isFlipped);
202 double t =
std::abs(stub.z()) / stub.r();
203 double eta = asinh(
t);
206 stubs_.push_back(stub);
212 out <<
"Event: " << eventnum_ << endl;
214 for (
auto& simtrack : simtracks_) {
217 out <<
"SimTrackEnd" << endl;
219 for (
auto& stub : stubs_) {
222 out <<
"StubEnd" << endl;
226 out <<
"Event: " << eventnum_ << endl;
228 for (
auto& simtrack : simtracks_) {
231 out <<
"SimTrackEnd" << endl;
233 for (
auto& stub : stubs_) {
236 out <<
"StubEnd" << endl;
239 unsigned int SLHCEvent::layersHit(
int tpid,
int&
nlayers,
int& ndisks) {
253 for (
auto& stub : stubs_) {
254 if (stub.tpmatch(tpid)) {
255 if (stub.layer() == 0)
257 if (stub.layer() == 1)
259 if (stub.layer() == 2)
261 if (stub.layer() == 3)
263 if (stub.layer() == 4)
265 if (stub.layer() == 5)
268 if (
abs(stub.disk()) == 1)
270 if (
abs(stub.disk()) == 2)
272 if (
abs(stub.disk()) == 3)
274 if (
abs(stub.disk()) == 4)
276 if (
abs(stub.disk()) == 5)
281 nlayers = l1 + l2 + l3 + l4 + l5 + l6;
282 ndisks =
d1 + d2 + d3 + d4 + d5;
284 return l1 + 2 * l2 + 4 * l3 + 8 * l4 + 16 * l5 + 32 * l6 + 64 *
d1 + 128 * d2 + 256 * d3 + 512 * d4 + 1024 * d5;
287 int SLHCEvent::getSimtrackFromSimtrackid(
int simtrackid,
int eventid)
const {
288 for (
unsigned int i = 0;
i < simtracks_.size();
i++) {
289 if (simtracks_[
i].trackid() == simtrackid && simtracks_[
i].eventid() == eventid)