QwAnalysis
QwEvent.cc
Go to the documentation of this file.
1 #include "QwEvent.h"
5 
6 // Qweak headers
7 #include "QwLog.h"
8 #include "QwUnits.h"
9 #include "QwParameterFile.h"
10 #include "QwHit.h"
11 #include "QwHitContainer.h"
12 #include "QwTreeLine.h"
13 #include "QwPartialTrack.h"
14 #include "QwTrack.h"
15 #include "QwVertex.h"
16 
17 // Initialize beam energy
18 Double_t QwEvent::fBeamEnergy = 1.165 * Qw::GeV;
19 
21 : fScatteringAngle(0.0),fScatteringVertexZ(0.0),fScatteringVertexR(0.0),
22  fCrossSection(-1.0),fPreScatteringEnergy(0.0),fOriginVertexEnergy(0.0),
23  fPrimaryQ2(0.0)
24 {
25  // Reset the event header
26  fEventHeader = 0;
27 
28  fNQwHits = 0;
29  fNQwTreeLines = 0;
31  fNQwTracks = 0;
32 
33  // Loop over all pointer objects
34  for (int i = 0; i < kNumPackages; ++i) {
35  for (int j = 0; j < kNumRegions; ++j) {
36  // Null the treeline pointers
37  for (int k = 0; k < kNumDirections; ++k) {
38  fTreeLine[i][j][k] = 0;
39  } // end of loop over directions
40  } // end of loop over regions
41  } // end of loop over packages
42 
43  // Clear the event
44  Clear();
45 }
46 
47 
49 {
50  // Clear the event
51  Clear();
52 
53  // Loop over all allocated objects
54  for (int i = 0; i < kNumPackages; ++i) {
55 
56  for (int j = 0; j < kNumRegions; ++j) {
57 
58  // Delete all those treelines
59  for (int k = 0; k < kNumDirections; ++k) {
60  QwTreeLine* tl = fTreeLine[i][j][k];
61  while (tl) {
62  QwTreeLine* tl_next = tl->next;
63  delete tl;
64  tl = tl_next;
65  }
66  } // end of loop over directions
67  } // end of loop over regions
68  } // end of loop over packages
69 
70 
71  // Delete the event header
72  if (fEventHeader) delete fEventHeader;
73 }
74 
75 
76 // Clear the local TClonesArrays
77 void QwEvent::Clear(Option_t *option)
78 {
79  ClearHits(option);
80  ClearTreeLines(option);
81  ClearPartialTracks(option);
82  ClearTracks(option);
83 }
84 
85 // Delete the static TClonesArrays
86 void QwEvent::Reset(Option_t *option)
87 {
88  ResetHits(option);
89  ResetTreeLines(option);
90  ResetPartialTracks(option);
91  ResetTracks(option);
92 }
93 
94 
95 /**
96  * Load the beam properties from a map file.
97  * @param map Name of map file
98  */
99 void QwEvent::LoadBeamProperty(const TString& map)
100 {
101  QwParameterFile mapstr(map.Data());
102  while (mapstr.ReadNextLine())
103  {
104  mapstr.TrimComment(); // Remove everything after a comment character.
105  mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
106  if (mapstr.LineIsEmpty()) continue;
107 
108  TString varname, varvalue;
109  if (mapstr.HasVariablePair("=",varname,varvalue)) {
110  // This is a declaration line. Decode it.
111  varname.ToLower();
112  if (varname == "energy") {
113  fBeamEnergy = atof(varvalue.Data()) * Qw::MeV;
114  QwMessage << "Beam energy set to " << fBeamEnergy / Qw::GeV << " GeV" << QwLog::endl;
115  }
116  }
117  }
118 }
119 
120 
121 /**
122  * Calculate the energy loss in the hydrogen target
123  *
124  * @param vertex_z Longitudinal position of vertex (absolute coordinates)
125  * @returns Energy loss
126  */
127 double QwEvent::EnergyLossHydrogen(const double vertex_z)
128 {
129  // Target parameters
130  double target_z_length = 34.35; // Target Length (cm)
131  double target_z_position= -652.67; // Target center position (cm) in Z
132  double target_z_front = target_z_position - 0.5 * target_z_length;
133  double target_z_back = target_z_position + 0.5 * target_z_length;
134 
135  // Energy loss in hydrogen target
136  double pre_loss = 0.0;
137  if (vertex_z < target_z_front) {
138  // Before target
139  pre_loss = 0.05 * Qw::MeV;
140 
141  } else if (vertex_z >= target_z_front && vertex_z <= target_z_back) {
142  // Inside target
143  double depth = vertex_z - target_z_front;
144  //pre_loss = 20.08 * Qw::MeV * depth/target_z_length; // linear approximation
145  pre_loss = 0.05 + depth*0.6618 - 0.003462*depth*depth; // quadratic fit approximation
146 
147  } else {
148  // After target
149  pre_loss = 18.7 * Qw::MeV; // averaged total Eloss, full target (excluding downstream Al window)
150  }
151 
152  return pre_loss;
153 }
154 
155 
156 /**
157  * Calculate the kinematic variables for a given track
158  *
159  * @param track Reconstructed track
160  */
162 {
163  if (! track) {
164  QwWarning << "QwEvent::CalculateKinematics: "
165  << "called with null track pointer." << QwLog::endl;
166  return;
167  }
168 
169  if (! (track->fFront)) {
170  QwWarning << "QwEvent::CalculateKinematics: "
171  << "full track with null front track pointer." << QwLog::endl;
172  return;
173  }
174 
175  // Beam energy
176  Double_t energy = fBeamEnergy;
177 
178  // Longitudinal vertex in target from front partial track
179  Double_t vertex_z = track->fFront->GetVertexZ();
180  fVertexPosition = track->fFront->GetPosition(vertex_z);
184 
185  // Scattering angle from front partial track
186  Double_t theta = track->fFront->GetMomentumDirectionTheta();
187  Double_t cos_theta = cos(theta);
188  fScatteringAngle = theta / Qw::deg;
189 
190  // Prescattering energy loss
191  Double_t pre_loss = EnergyLossHydrogen(vertex_z);
192  fHydrogenEnergyLoss = pre_loss;
193 
194  // Generic scattering without energy loss
195  Double_t P0 = energy;
196  Double_t PP = track->fMomentum;
197  Double_t Q2 = 2.0 * P0 * PP * (1 - cos_theta);
198  fKin.fP0 = P0 / Qw::GeV;
199  fKin.fPp = PP / Qw::GeV;
200  fKin.fQ2 = Q2 / Qw::GeV2;
201  fKin.fNu = (P0 - PP) / Qw::GeV;
202  fKin.fW2 = (Qw::Mp * Qw::Mp + 2.0 * Qw::Mp * (P0 - PP) - Q2) / Qw::GeV2;
203  fKin.fX = Q2 / (2.0 * Qw::Mp * (P0 - PP));
204  fKin.fY = (P0 - PP) / P0;
205 
206  // Generic scattering with energy loss
207  P0 = energy - pre_loss;
208  PP = track->fMomentum;
209  Q2 = 2.0 * P0 * PP * (1 - cos_theta);
210  fKinWithLoss.fP0 = P0 / Qw::GeV;
211  fKinWithLoss.fPp = PP / Qw::GeV;
212  fKinWithLoss.fQ2 = Q2 / Qw::GeV2;
213  fKinWithLoss.fNu = (P0 - PP) / Qw::GeV;
214  fKinWithLoss.fW2 = (Qw::Mp * Qw::Mp + 2.0 * Qw::Mp * (P0 - PP) - Q2) / Qw::GeV2;
215  fKinWithLoss.fX = Q2 / (2.0 * Qw::Mp * (P0 - PP));
216  fKinWithLoss.fY = (P0 - PP) / P0;
217 
218  // Elastic scattering without energy loss
219  P0 = energy * Qw::MeV;
220  PP = Qw::Mp * P0 / (Qw::Mp + P0 * (1 - cos_theta));
221  Q2 = 2.0 * P0 * PP * (1 - cos_theta);
222  fKinElastic.fP0 = P0 / Qw::GeV;
223  fKinElastic.fPp = PP / Qw::GeV;
224  fKinElastic.fQ2 = Q2 / Qw::GeV2;
225  fKinElastic.fNu = (P0 - PP) / Qw::GeV;
226  fKinElastic.fW2 = (Qw::Mp * Qw::Mp + 2.0 * Qw::Mp * (P0 - PP) - Q2) / Qw::GeV2;
227  fKinElastic.fX = Q2 / (2.0 * Qw::Mp * (P0 - PP));
228  fKinElastic.fY = (P0 - PP) / P0;
229 
230  // Elastic scattering with energy loss
231  P0 = (energy - pre_loss) * Qw::MeV;
232  PP = Qw::Mp * P0 / (Qw::Mp + P0 * (1 - cos_theta));
233  Q2 = 2.0 * P0 * PP * (1 - cos_theta);
237  fKinElasticWithLoss.fNu = (P0 - PP) / Qw::GeV;
238  fKinElasticWithLoss.fW2 = (Qw::Mp * Qw::Mp + 2.0 * Qw::Mp * (P0 - PP) - Q2) / Qw::GeV2;
239  fKinElasticWithLoss.fX = Q2 / (2.0 * Qw::Mp * (P0 - PP));
240  fKinElasticWithLoss.fY = (P0 - PP) / P0;
241 
243 }
244 
245 // Print the event
246 void QwEvent::Print(Option_t* option) const
247 {
248  // Event header
250  // Event kinematics
251  QwOut << "P0 = " << fKin.fP0 << " GeV/c" << QwLog::endl;
252  QwOut << "PP = " << fKin.fPp << " GeV/c" << QwLog::endl;
253  QwOut << "Q^2 = " << fKin.fQ2 << " (GeV/c)^2" << QwLog::endl;
254  //std::cout << "weight = " << fCrossSectionWeight << std::endl;
255  //std::cout << "energy = " << fTotalEnergy/Qw::MeV << " MeV" << std::endl;
256  //std::cout << "momentum = " << fMomentum / Qw::MeV << " MeV" << std::endl;
257  //std::cout << "vertex position = " << fVertexPosition.Z()/Qw::cm << " cm" << std::endl;
258  //std::cout << "vertex momentum = " << fVertexMomentum.Z()/Qw::MeV << " MeV" << std::endl;
259 
260  // Event content
261  QwOut << "Hits in this event:" << QwLog::endl;
262  PrintHits(option);
263  QwOut << "Tree lines in this event:" << QwLog::endl;
264  PrintTreeLines(option);
265  QwOut << "Partial tracks in this event:" << QwLog::endl;
266  PrintPartialTracks(option);
267  QwOut << "Tracks in this event:" << QwLog::endl;
268  PrintTracks(option);
269 }
270 
271 
272 // Create a new QwHit
274 {
275  QwHit* hit = new QwHit();
276  AddHit(hit);
277  return hit;
278 }
279 
280 // Add an existing QwHit
281 void QwEvent::AddHit(const QwHit* hit)
282 {
283  if (hit) fQwHits.push_back(new QwHit(hit));
284  else QwError << "trying to add null hit" << QwLog::endl;
285  fNQwHits++;
286 }
287 
288 // Clear the local TClonesArray of hits
289 void QwEvent::ClearHits(Option_t *option)
290 {
291  for (size_t i = 0; i < fQwHits.size(); i++)
292  delete fQwHits.at(i);
293  fQwHits.clear();
294  fNQwHits = 0;
295 }
296 
297 // Delete the static TClonesArray of hits
298 void QwEvent::ResetHits(Option_t *option)
299 {
300  ClearHits();
301 }
302 
303 // Get the specified hit
304 const QwHit* QwEvent::GetHit(const int hit) const
305 {
306  if (hit < 0 || hit > GetNumberOfHits()) return 0;
307  return fQwHits.at(hit);
308 }
309 
310 // Print the hits
311 void QwEvent::PrintHits(Option_t* option) const
312 {
313  for (std::vector<QwHit*>::const_iterator hit = fQwHits.begin();
314  hit != fQwHits.end(); ++hit) {
315  if ((*hit)->GetDriftDistance() != -5)
316  std::cout << **hit << std::endl;
317  }
318 }
319 
320 
321 // Add the hits of a QwHitContainer to the TClonesArray
323 {
324  for (QwHitContainer::const_iterator hit = hitlist->begin();
325  hit != hitlist->end(); hit++) {
326  const QwHit* p = &(*hit);
327  AddHit(p);
328  }
329 }
330 
331 // Get the hits from the TClonesArray to a QwHitContainer
333 {
334  QwHitContainer* hitlist = new QwHitContainer();
335  for (std::vector<QwHit*>::const_iterator hit = fQwHits.begin();
336  hit != fQwHits.end(); hit++)
337  if (*hit)
338  hitlist->push_back(*hit);
339  else
340  QwError << "null hit in hit list" << QwLog::endl;
341  return hitlist;
342 }
343 
344 
345 // Create a new QwTreeLine
347 {
348  QwTreeLine* treeline = new QwTreeLine();
349  AddTreeLine(treeline);
350  return treeline;
351 }
352 
353 // Add an existing QwTreeLine
354 void QwEvent::AddTreeLine(const QwTreeLine* treeline)
355 {
356  fQwTreeLines.push_back(new QwTreeLine(treeline));
357  fNQwTreeLines++;
358 }
359 
360 // Add a linked list of QwTreeLine's
361 void QwEvent::AddTreeLineList(const QwTreeLine* treelinelist)
362 {
363  for (const QwTreeLine *treeline = treelinelist;
364  treeline; treeline = treeline->next){
365  if (treeline->IsValid()){
366  AddTreeLine(treeline);
367  }
368  }
369 }
370 
371 // Add a vector of QwTreeLine's
372 void QwEvent::AddTreeLineList(const std::vector<QwTreeLine*>& treelinelist)
373 {
374  for (size_t i = 0; i < treelinelist.size(); i++)
375  if (treelinelist[i]->IsValid())
376  AddTreeLine(treelinelist[i]);
377 }
378 
379 // Clear the local TClonesArray of tree lines
380 void QwEvent::ClearTreeLines(Option_t *option)
381 {
382  for (size_t i = 0; i < fQwTreeLines.size(); i++) {
383  QwTreeLine* tl = fQwTreeLines.at(i);
384  delete tl;
385  }
386  fQwTreeLines.clear();
387  fNQwTreeLines = 0;
388 }
389 
390 // Delete the static TClonesArray of tree lines
391 void QwEvent::ResetTreeLines(Option_t *option)
392 {
393  ClearTreeLines();
394 }
395 
396 // Get the specified tree line
397 const QwTreeLine* QwEvent::GetTreeLine(const int tl) const
398 {
399  if (tl < 0 || tl > GetNumberOfTreeLines()) return 0;
400  return fQwTreeLines.at(tl);
401 }
402 
403 // Print the tree lines
404 void QwEvent::PrintTreeLines(Option_t* option) const
405 {
406  for (std::vector<QwTreeLine*>::const_iterator treeline = fQwTreeLines.begin();
407  treeline != fQwTreeLines.end(); treeline++) {
408  std::cout << **treeline << std::endl;
409  QwTreeLine* tl = (*treeline)->next;
410  while (tl) {
411  std::cout << *tl << std::endl;
412  tl = tl->next;
413  }
414  }
415 }
416 
417 const std::vector<QwTreeLine*> QwEvent::GetListOfTreeLines(EQwRegionID region, EQwDirectionID direction) const
418 {
419  std::vector<QwTreeLine*> treelines;
420  for (std::vector<QwTreeLine*>::const_iterator
421  tl = fQwTreeLines.begin();
422  tl != fQwTreeLines.end(); tl++) {
423  if ((*tl)->GetRegion() == region) {
424  if ((*tl)->GetDirection() == direction) {
425  treelines.push_back(*tl);
426  }
427  }
428  }
429  return treelines;
430 }
431 
432 
433 // Create a new QwPartialTrack
435 {
436  QwPartialTrack* partialtrack = new QwPartialTrack();
437  AddPartialTrack(partialtrack);
438  return partialtrack;
439 }
440 
441 // Add an existing QwPartialTrack
442 void QwEvent::AddPartialTrack(const QwPartialTrack* partialtrack)
443 {
444  fQwPartialTracks.push_back(new QwPartialTrack(partialtrack));
446 }
447 
448 // Add a vector of QwPartialTracks
449 void QwEvent::AddPartialTrackList(const std::vector<QwPartialTrack*>& partialtracklist)
450 {
451  for (size_t i = 0; i < partialtracklist.size(); i++)
452  if (partialtracklist[i]->IsValid())
453  AddPartialTrack(partialtracklist[i]);
454 }
455 
456 // Clear the local TClonesArray of hits
457 void QwEvent::ClearPartialTracks(Option_t *option)
458 {
459  for (size_t i = 0; i < fQwPartialTracks.size(); i++)
460  delete fQwPartialTracks.at(i);
461  fQwPartialTracks.clear();
462  fNQwPartialTracks = 0;
463 }
464 
465 // Delete the static TClonesArray of partial tracks
466 void QwEvent::ResetPartialTracks(Option_t *option)
467 {
469 }
470 
471 // Get the specified partial track
472 const QwPartialTrack* QwEvent::GetPartialTrack(const int pt) const
473 {
474  if (pt < 0 || pt > GetNumberOfPartialTracks()) return 0;
475  return fQwPartialTracks.at(pt);
476 }
477 
478 // Print the partial tracks
479 void QwEvent::PrintPartialTracks(Option_t* option) const
480 {
481  for (std::vector<QwPartialTrack*>::const_iterator parttrack =
482  fQwPartialTracks.begin(); parttrack != fQwPartialTracks.end();
483  ++parttrack)
484  std::cout << **parttrack << std::endl;
485 }
486 
487 // Get the list of partial tracks in region
488 const std::vector<QwPartialTrack*> QwEvent::GetListOfPartialTracks(
489  EQwRegionID region,
490  EQwDetectorPackage package) const
491 {
492  std::vector<QwPartialTrack*> partialtracks;
493  for (std::vector<QwPartialTrack*>::const_iterator
494  pt = fQwPartialTracks.begin();
495  pt != fQwPartialTracks.end(); pt++) {
496  if ((*pt)->GetRegion() == region) {
497  if ((*pt)->GetPackage() == package) {
498  partialtracks.push_back(*pt);
499  }
500  }
501  }
502  return partialtracks;
503 }
504 
505 
506 // Create a new QwTrack
508 {
509  QwTrack* track = new QwTrack();
510  AddTrack(track);
511  return track;
512 }
513 
514 // Add an existing QwTrack
515 void QwEvent::AddTrack(const QwTrack* track)
516 {
517  fQwTracks.push_back(new QwTrack(track));
518  ++fNQwTracks;
519 }
520 
521 // Add a vector of QwTracks
522 void QwEvent::AddTrackList(const std::vector<QwTrack*>& tracklist)
523 {
524  for (size_t i = 0; i < tracklist.size(); i++)
525  //if (tracklist[i]->IsValid()) // TODO
526  AddTrack(tracklist[i]);
527 }
528 
529 // Clear the local TClonesArray of hits
530 void QwEvent::ClearTracks(Option_t *option)
531 {
532  for (size_t i = 0; i < fQwTracks.size(); i++)
533  delete fQwTracks.at(i);
534  fQwTracks.clear();
535  fNQwTracks = 0;
536 }
537 
538 // Delete the static TClonesArray of tracks
539 void QwEvent::ResetTracks(Option_t *option)
540 {
541  ClearTracks();
542 }
543 
544 // Get the specified track
545 const QwTrack* QwEvent::GetTrack(const int t) const
546 {
547  if (t < 0 || t > GetNumberOfTracks()) return 0;
548  return fQwTracks.at(t);
549 }
550 
551 // Print the tracks
552 void QwEvent::PrintTracks(Option_t* option) const
553 {
554  for (std::vector<QwTrack*>::const_iterator track = fQwTracks.begin();
555  track != fQwTracks.end(); track++)
556  std::cout << **track << std::endl;
557 }
Double_t fPrimaryQ2
&lt; Momentum transfer Q^2 assuming elastic scattering with hydrogen energy loss
Definition: QwEvent.h:355
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Int_t fNQwHits
Number of QwHits in the array.
Definition: QwEvent.h:168
Int_t GetNumberOfHits() const
Get the number of hits.
Definition: QwEvent.h:230
void AddTreeLine(const QwTreeLine *treeline)
Add an existing tree line as a copy.
Definition: QwEvent.cc:354
#define QwOut
Predefined log drain for explicit output.
Definition: QwLog.h:35
void ClearHits(Option_t *option="")
Clear the list of hits.
Definition: QwEvent.cc:289
const QwTreeLine * GetTreeLine(const int tl) const
Get the specified tree line.
Definition: QwEvent.cc:397
void AddPartialTrackList(const std::vector< QwPartialTrack * > &partialtracklist)
Add a list of existing partial tracks as a copy.
Definition: QwEvent.cc:449
void ResetTracks(Option_t *option="")
Reset the list of tracks.
Definition: QwEvent.cc:539
std::vector< QwPartialTrack * > fQwPartialTracks
Array of QwPartialTracks.
Definition: QwEvent.h:177
void AddHitContainer(const QwHitContainer *hitlist)
Add the hits in a hit container as a copy.
Definition: QwEvent.cc:322
const std::vector< QwTreeLine * > & GetListOfTreeLines() const
Get the list of tree lines.
Definition: QwEvent.h:256
TVector3 fVertexPosition
Vertex position.
Definition: QwEvent.h:342
void AddTrack(const QwTrack *track)
Add an existing track as a copy.
Definition: QwEvent.cc:515
Int_t GetNumberOfTreeLines() const
Get the number of tree lines.
Definition: QwEvent.h:254
double EnergyLossHydrogen(const double vertex_z)
Calculate the energy loss in the hydrogen target.
Definition: QwEvent.cc:127
Contains header information of a tracked event.
Definition: QwEvent.h:37
double fScatteringAngle
Scattering angle.
Definition: QwEvent.h:336
static const double deg
Definition: QwUnits.h:106
double fW2
Invariant mass squared of the recoiling target system.
Definition: QwEvent.h:138
double fScatteringVertexR
Scattering vertex radial distance.
Definition: QwEvent.h:338
void TrimComment(const char commentchar)
static double fBeamEnergy
Electron beam energy.
Definition: QwEvent.h:320
void ClearTracks(Option_t *option="")
Clear the list of tracks.
Definition: QwEvent.cc:530
Double_t GetMomentumDirectionTheta() const
Return the theta angle.
QwKinematics fKin
Inclusive scattering.
Definition: QwEvent.h:348
TVector3 fVertexMomentum
Vertex momentum.
Definition: QwEvent.h:343
EQwDetectorPackage
Definition: QwTypes.h:70
const TVector3 GetPosition(const double z) const
Return the vertex at position z.
Definition of the partial track class.
std::vector< QwTrack * > fQwTracks
Array of QwTracks.
Definition: QwEvent.h:181
QwKinematics fKinElasticWithLoss
Scattering assuming elastic reaction and hydrogen energy loss.
Definition: QwEvent.h:351
Definition of the track class.
double fP0
Incoming momentum .
Definition: QwEvent.h:133
const QwHit * GetHit(const int hit) const
Get the specified hit.
Definition: QwEvent.cc:304
QwEvent()
Default constructor.
Definition: QwEvent.cc:20
Int_t fNQwTreeLines
Number of QwTreeLines in the array.
Definition: QwEvent.h:172
double fQ2
Four-momentum transfer squared .
Definition: QwEvent.h:137
void ResetPartialTracks(Option_t *option="")
Reset the list of partial tracks.
Definition: QwEvent.cc:466
Contains a tracked event, i.e. all information from hits to tracks.
Definition: QwEvent.h:156
Int_t GetNumberOfTracks() const
Get the number of tracks.
Definition: QwEvent.h:302
EQwRegionID
Definition: QwTypes.h:16
Int_t fNQwTracks
Number of QwTracks in the array.
Definition: QwEvent.h:180
void ResetHits(Option_t *option="")
Reset the list of hits.
Definition: QwEvent.cc:298
A logfile class, based on an identical class in the Hermes analyzer.
double fNu
Energy loss of the electron .
Definition: QwEvent.h:139
const TVector3 GetMomentumDirection() const
Return the direction.
void AddTrackList(const std::vector< QwTrack * > &tracklist)
Add a list of existing partial tracks as a copy.
Definition: QwEvent.cc:522
Draft skeleton for the decoding-to-QTR interface class.
QwHit * CreateNewHit()
Create a new hit.
Definition: QwEvent.cc:273
const QwPartialTrack * GetPartialTrack(const int pt) const
Get the specified partial track.
Definition: QwEvent.cc:472
double fPp
Outgoing momentum .
Definition: QwEvent.h:136
QwKinematics fKinWithLoss
Scattering with hydrogen energy loss.
Definition: QwEvent.h:349
std::vector< QwTreeLine * > fQwTreeLines
Array of QwTreeLines.
Definition: QwEvent.h:173
void Print(Option_t *option="") const
Print the event.
Definition: QwEvent.cc:246
void PrintTracks(Option_t *option="") const
Print the list of tracks.
Definition: QwEvent.cc:552
static const double GeV2
Definition: QwUnits.h:97
Contains the complete track as a concatenation of partial tracks.
Definition: QwTrack.h:30
double fScatteringVertexZ
Scattering vertex z position.
Definition: QwEvent.h:337
void AddPartialTrack(const QwPartialTrack *partialtrack)
Add an existing partial track as a copy.
Definition: QwEvent.cc:442
QwPartialTrack * CreateNewPartialTrack()
Create a new partial track.
Definition: QwEvent.cc:434
Double_t GetVertexZ() const
Get the vertex position.
void LoadBeamProperty(const TString &map)
Load the beam properties from a map file.
Definition: QwEvent.cc:99
double fY
Fractional energy loss .
Definition: QwEvent.h:141
void Reset(Option_t *option="")
Definition: QwEvent.cc:86
const std::vector< QwPartialTrack * > & GetListOfPartialTracks() const
Get the list of partial tracks.
Definition: QwEvent.h:282
QwEventHeader * fEventHeader
Definition: QwEvent.h:161
QwTrack * CreateNewTrack()
Create a new track.
Definition: QwEvent.cc:507
Int_t GetNumberOfPartialTracks() const
Get the number of partial tracks.
Definition: QwEvent.h:278
Definition of the one-dimensional track stubs.
static const double GeV
Definition: QwUnits.h:95
void AddHit(const QwHit *hit)
Add an existing hit as a copy.
Definition: QwEvent.cc:281
static const double Mp
Mass of the proton.
Definition: QwUnits.h:119
QwHitContainer * GetHitContainer()
Get the list of hits as a hit container.
Definition: QwEvent.cc:332
One-dimensional (u, v, or x) track stubs and associated hits.
Definition: QwTreeLine.h:51
const QwTrack * GetTrack(const int t) const
Get the specified track.
Definition: QwEvent.cc:545
double fHydrogenEnergyLoss
Pre-scattering target energy loss assuming LH2 target.
Definition: QwEvent.h:335
Kinematic variables.
Definition: QwEvent.h:129
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
QwPartialTrack * fFront
Front partial track.
Definition: QwTrack.h:147
EQwDirectionID
Definition: QwTypes.h:41
ClassImp(QwF1TDC)
void Clear(Option_t *option="")
Definition: QwEvent.cc:77
void CalculateKinematics(const QwTrack *track)
Calculate the kinematic variables for a given track.
Definition: QwEvent.cc:161
void PrintHits(Option_t *option="") const
Print the list of hits.
Definition: QwEvent.cc:311
QwTreeLine * next
Definition: QwTreeLine.h:231
double fX
Bjorken-x scaling variable .
Definition: QwEvent.h:140
void ClearPartialTracks(Option_t *option="")
Clear the list of partial tracks.
Definition: QwEvent.cc:457
static const double MeV
Definition: QwUnits.h:94
Int_t fNQwPartialTracks
Number of QwPartialTracks in the array.
Definition: QwEvent.h:176
Hit structure uniquely defining each hit.
Definition: QwHit.h:43
void AddTreeLineList(const QwTreeLine *treelinelist)
Add a list of existing tree lines as a copy.
Definition: QwEvent.cc:361
QwTreeLine * fTreeLine[kNumPackages][kNumRegions][kNumDirections]
Definition: QwEvent.h:358
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45
void ClearTreeLines(Option_t *option="")
Clear the list of tree lines.
Definition: QwEvent.cc:380
void ResetTreeLines(Option_t *option="")
Reset the list of tree lines.
Definition: QwEvent.cc:391
double fMomentum
Spectrometer momentum.
Definition: QwTrack.h:100
void PrintTreeLines(Option_t *option="") const
Print the list of tree lines.
Definition: QwEvent.cc:404
virtual ~QwEvent()
Virtual destructor.
Definition: QwEvent.cc:48
Contains the straight part of a track in one region only.
std::vector< QwHit * > fQwHits
Array of QwHits.
Definition: QwEvent.h:169
void PrintPartialTracks(Option_t *option="") const
Print the list of partial tracks.
Definition: QwEvent.cc:479
QwKinematics fKinElastic
Scattering assuming elastic reaction.
Definition: QwEvent.h:350
QwTreeLine * CreateNewTreeLine()
Create a new tree line.
Definition: QwEvent.cc:346
#define QwError
Predefined log drain for errors.
Definition: QwLog.h:40
static const double cm
Length units: base unit is mm.
Definition: QwUnits.h:61