21 : fScatteringAngle(0.0),fScatteringVertexZ(0.0),fScatteringVertexR(0.0),
22 fCrossSection(-1.0),fPreScatteringEnergy(0.0),fOriginVertexEnergy(0.0),
102 while (mapstr.ReadNextLine())
105 mapstr.TrimWhitespace();
106 if (mapstr.LineIsEmpty())
continue;
108 TString varname, varvalue;
109 if (mapstr.HasVariablePair(
"=",varname,varvalue)) {
112 if (varname ==
"energy") {
130 double target_z_length = 34.35;
131 double target_z_position= -652.67;
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;
136 double pre_loss = 0.0;
137 if (vertex_z < target_z_front) {
141 }
else if (vertex_z >= target_z_front && vertex_z <= target_z_back) {
143 double depth = vertex_z - target_z_front;
145 pre_loss = 0.05 + depth*0.6618 - 0.003462*depth*depth;
164 QwWarning <<
"QwEvent::CalculateKinematics: "
165 <<
"called with null track pointer." <<
QwLog::endl;
170 QwWarning <<
"QwEvent::CalculateKinematics: "
171 <<
"full track with null front track pointer." <<
QwLog::endl;
187 Double_t cos_theta = cos(theta);
195 Double_t P0 = energy;
197 Double_t Q2 = 2.0 * P0 * PP * (1 - cos_theta);
207 P0 = energy - pre_loss;
209 Q2 = 2.0 * P0 * PP * (1 - cos_theta);
221 Q2 = 2.0 * P0 * PP * (1 - cos_theta);
231 P0 = (energy - pre_loss) * Qw::MeV;
233 Q2 = 2.0 * P0 * PP * (1 - cos_theta);
291 for (
size_t i = 0; i <
fQwHits.size(); i++)
313 for (std::vector<QwHit*>::const_iterator hit =
fQwHits.begin();
315 if ((*hit)->GetDriftDistance() != -5)
316 std::cout << **hit << std::endl;
324 for (QwHitContainer::const_iterator hit = hitlist->begin();
325 hit != hitlist->end(); hit++) {
326 const QwHit* p = &(*hit);
335 for (std::vector<QwHit*>::const_iterator hit =
fQwHits.begin();
338 hitlist->push_back(*hit);
363 for (
const QwTreeLine *treeline = treelinelist;
364 treeline; treeline = treeline->
next){
365 if (treeline->IsValid()){
374 for (
size_t i = 0; i < treelinelist.size(); i++)
375 if (treelinelist[i]->IsValid())
406 for (std::vector<QwTreeLine*>::const_iterator treeline =
fQwTreeLines.begin();
408 std::cout << **treeline << std::endl;
411 std::cout << *tl << std::endl;
419 std::vector<QwTreeLine*> treelines;
420 for (std::vector<QwTreeLine*>::const_iterator
423 if ((*tl)->GetRegion() == region) {
424 if ((*tl)->GetDirection() == direction) {
425 treelines.push_back(*tl);
451 for (
size_t i = 0; i < partialtracklist.size(); i++)
452 if (partialtracklist[i]->IsValid())
481 for (std::vector<QwPartialTrack*>::const_iterator parttrack =
484 std::cout << **parttrack << std::endl;
492 std::vector<QwPartialTrack*> partialtracks;
493 for (std::vector<QwPartialTrack*>::const_iterator
496 if ((*pt)->GetRegion() == region) {
497 if ((*pt)->GetPackage() == package) {
498 partialtracks.push_back(*pt);
502 return partialtracks;
524 for (
size_t i = 0; i < tracklist.size(); i++)
532 for (
size_t i = 0; i <
fQwTracks.size(); i++)
554 for (std::vector<QwTrack*>::const_iterator track =
fQwTracks.begin();
556 std::cout << **track << std::endl;
Double_t fPrimaryQ2
< Momentum transfer Q^2 assuming elastic scattering with hydrogen energy loss
#define QwMessage
Predefined log drain for regular messages.
Int_t fNQwHits
Number of QwHits in the array.
Int_t GetNumberOfHits() const
Get the number of hits.
void AddTreeLine(const QwTreeLine *treeline)
Add an existing tree line as a copy.
#define QwOut
Predefined log drain for explicit output.
void ClearHits(Option_t *option="")
Clear the list of hits.
const QwTreeLine * GetTreeLine(const int tl) const
Get the specified tree line.
void AddPartialTrackList(const std::vector< QwPartialTrack * > &partialtracklist)
Add a list of existing partial tracks as a copy.
void ResetTracks(Option_t *option="")
Reset the list of tracks.
std::vector< QwPartialTrack * > fQwPartialTracks
Array of QwPartialTracks.
void AddHitContainer(const QwHitContainer *hitlist)
Add the hits in a hit container as a copy.
const std::vector< QwTreeLine * > & GetListOfTreeLines() const
Get the list of tree lines.
TVector3 fVertexPosition
Vertex position.
void AddTrack(const QwTrack *track)
Add an existing track as a copy.
Int_t GetNumberOfTreeLines() const
Get the number of tree lines.
double EnergyLossHydrogen(const double vertex_z)
Calculate the energy loss in the hydrogen target.
Contains header information of a tracked event.
double fScatteringAngle
Scattering angle.
double fW2
Invariant mass squared of the recoiling target system.
double fScatteringVertexR
Scattering vertex radial distance.
void TrimComment(const char commentchar)
static double fBeamEnergy
Electron beam energy.
void ClearTracks(Option_t *option="")
Clear the list of tracks.
Double_t GetMomentumDirectionTheta() const
Return the theta angle.
QwKinematics fKin
Inclusive scattering.
TVector3 fVertexMomentum
Vertex momentum.
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.
QwKinematics fKinElasticWithLoss
Scattering assuming elastic reaction and hydrogen energy loss.
Definition of the track class.
double fP0
Incoming momentum .
const QwHit * GetHit(const int hit) const
Get the specified hit.
QwEvent()
Default constructor.
Int_t fNQwTreeLines
Number of QwTreeLines in the array.
double fQ2
Four-momentum transfer squared .
void ResetPartialTracks(Option_t *option="")
Reset the list of partial tracks.
Contains a tracked event, i.e. all information from hits to tracks.
Int_t GetNumberOfTracks() const
Get the number of tracks.
Int_t fNQwTracks
Number of QwTracks in the array.
void ResetHits(Option_t *option="")
Reset the list of hits.
A logfile class, based on an identical class in the Hermes analyzer.
double fNu
Energy loss of the electron .
const TVector3 GetMomentumDirection() const
Return the direction.
void AddTrackList(const std::vector< QwTrack * > &tracklist)
Add a list of existing partial tracks as a copy.
Draft skeleton for the decoding-to-QTR interface class.
QwHit * CreateNewHit()
Create a new hit.
const QwPartialTrack * GetPartialTrack(const int pt) const
Get the specified partial track.
double fPp
Outgoing momentum .
QwKinematics fKinWithLoss
Scattering with hydrogen energy loss.
std::vector< QwTreeLine * > fQwTreeLines
Array of QwTreeLines.
void Print(Option_t *option="") const
Print the event.
void PrintTracks(Option_t *option="") const
Print the list of tracks.
Contains the complete track as a concatenation of partial tracks.
double fScatteringVertexZ
Scattering vertex z position.
void AddPartialTrack(const QwPartialTrack *partialtrack)
Add an existing partial track as a copy.
QwPartialTrack * CreateNewPartialTrack()
Create a new partial track.
Double_t GetVertexZ() const
Get the vertex position.
void LoadBeamProperty(const TString &map)
Load the beam properties from a map file.
double fY
Fractional energy loss .
void Reset(Option_t *option="")
const std::vector< QwPartialTrack * > & GetListOfPartialTracks() const
Get the list of partial tracks.
QwEventHeader * fEventHeader
QwTrack * CreateNewTrack()
Create a new track.
Int_t GetNumberOfPartialTracks() const
Get the number of partial tracks.
Definition of the one-dimensional track stubs.
void AddHit(const QwHit *hit)
Add an existing hit as a copy.
static const double Mp
Mass of the proton.
QwHitContainer * GetHitContainer()
Get the list of hits as a hit container.
One-dimensional (u, v, or x) track stubs and associated hits.
const QwTrack * GetTrack(const int t) const
Get the specified track.
double fHydrogenEnergyLoss
Pre-scattering target energy loss assuming LH2 target.
static std::ostream & endl(std::ostream &)
End of the line.
QwPartialTrack * fFront
Front partial track.
void Clear(Option_t *option="")
void CalculateKinematics(const QwTrack *track)
Calculate the kinematic variables for a given track.
void PrintHits(Option_t *option="") const
Print the list of hits.
double fX
Bjorken-x scaling variable .
void ClearPartialTracks(Option_t *option="")
Clear the list of partial tracks.
Int_t fNQwPartialTracks
Number of QwPartialTracks in the array.
Hit structure uniquely defining each hit.
void AddTreeLineList(const QwTreeLine *treelinelist)
Add a list of existing tree lines as a copy.
QwTreeLine * fTreeLine[kNumPackages][kNumRegions][kNumDirections]
#define QwWarning
Predefined log drain for warnings.
void ClearTreeLines(Option_t *option="")
Clear the list of tree lines.
void ResetTreeLines(Option_t *option="")
Reset the list of tree lines.
double fMomentum
Spectrometer momentum.
void PrintTreeLines(Option_t *option="") const
Print the list of tree lines.
virtual ~QwEvent()
Virtual destructor.
Contains the straight part of a track in one region only.
std::vector< QwHit * > fQwHits
Array of QwHits.
void PrintPartialTracks(Option_t *option="") const
Print the list of partial tracks.
QwKinematics fKinElastic
Scattering assuming elastic reaction.
QwTreeLine * CreateNewTreeLine()
Create a new tree line.
#define QwError
Predefined log drain for errors.
static const double cm
Length units: base unit is mm.