/*
$Log$
+Revision 1.14 2002/05/19 18:17:03 hristov
+Changes needed by ICC/IFC compiler (Intel)
+
Revision 1.13 2002/03/09 18:35:35 nilsen
Added functions to print out Hit data members.
//
////////////////////////////////////////////////////////////////////////
//_____________________________________________________________________________
+AliITShit::AliITShit():AliHit(){
+ // Default Constructor
+ // Zero data member just to be safe.
+ // Intputs:
+ // none.
+ // Outputs:
+ // none.
+ // Return:
+ // A default created AliITShit class.
+
+ fStatus = 0; // Track Status
+ fLayer = 0; // Layer number
+ fLadder = 0; // Ladder number
+ fDet = 0; // Detector number
+ fPx = 0.0; // PX of particle at the point of the hit
+ fPy = 0.0; // PY of particle at the point of the hit
+ fPz = 0.0; // PZ of particle at the point of the hit
+ fDestep = 0.0; // Energy deposited in the current step
+ fTof = 0.0; // Time of flight at the point of the hit
+ fx0 = 0.0; // Starting point of this step
+ fy0 = 0.0; // Starting point of this step
+ fz0 = 0.0; // Starting point of this step
+ ft0 = 0.0; // Starting point of this step
+}
+AliITShit::AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,
+ Float_t tof,TLorentzVector &x,TLorentzVector &x0,
+ TLorentzVector &p) : AliHit(shunt, track){
+////////////////////////////////////////////////////////////////////////
+// Create ITS hit
+// The creator of the AliITShit class. The variables shunt and
+// track are passed to the creator of the AliHit class. See the AliHit
+// class for a full description. In the units of the Monte Carlo
+////////////////////////////////////////////////////////////////////////
+ // Intputs:
+ // Int_t shunt See AliHit
+ // Int_t track Track number, see AliHit
+ // Int_t *vol Array of integer hit data,
+ // vol[0] Layer where the hit is, 1-6 typicaly
+ // vol[1] Ladder where the hit is.
+ // vol[2] Detector number where the hit is
+ // vol[3] Set of status bits
+ // vol[4] Set of status bits at start
+ // Outputs:
+ // none.
+ // Return:
+ // A default created AliITShit class.
+
+ fLayer = vol[0]; // Layer number
+ fLadder = vol[2]; // Ladder number
+ fDet = vol[1]; // Detector number
+ fStatus = vol[3]; // Track status flags
+ fStatus0 = vol[4]; // Track status flag for start position.
+ fX = x.X(); // Track X global position
+ fY = x.Y(); // Track Y global position
+ fZ = x.Z(); // Track Z global position
+ fPx = p.Px(); // Track X Momentum
+ fPy = p.Py(); // Track Y Momentum
+ fPz = p.Pz(); // Track Z Momentum
+ fDestep = edep; // Track dE/dx for this step
+ fTof = tof ; // Track Time of Flight for this step
+ fx0 = x0.X(); // Track X global position
+ fy0 = x0.Y(); // Track Y global position
+ fz0 = x0.Z(); // Track Z global position
+}
+//______________________________________________________________________
AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
AliHit(shunt, track){
////////////////////////////////////////////////////////////////////////
// fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
// fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
////////////////////////////////////////////////////////////////////////
+ // Intputs:
+ // Int_t shunt See AliHit
+ // Int_t track Track number, see AliHit
+ // Int_t *vol Array of integer hit data,
+ // vol[0] Layer where the hit is, 1-6 typicaly
+ // vol[1] Ladder where the hit is.
+ // vol[2] Detector number where the hit is
+ // vol[3] Set of status bits
+ // Float_t *hits Array of hit information
+ // hits[0] X global position of this hit
+ // hits[1] Y global position of this hit
+ // hits[2] Z global position of this hit
+ // hits[3] Px global position of this hit
+ // hits[4] Py global position of this hit
+ // hits[5] Pz global position of this hit
+ // hits[6] Energy deposited by this step
+ // hits[7] Time of flight of this particle at this step
+ // Outputs:
+ // none.
+ // Return:
+ // A standard created AliITShit class.
fLayer = vol[0]; // Layer number
fLadder = vol[2]; // Ladder number
fDet = vol[1]; // Detector number
fStatus = vol[3]; // Track status flags
- fX = hits[0]; // Track X position
- fY = hits[1]; // Track Y position
- fZ = hits[2]; // Track Z position
+ fX = hits[0]; // Track X global position
+ fY = hits[1]; // Track Y global position
+ fZ = hits[2]; // Track Z global position
fPx = hits[3]; // Track X Momentum
fPy = hits[4]; // Track Y Momentum
fPz = hits[5]; // Track Z Momentum
*os << fLayer << " " << fLadder << " " << fDet << " ";;
*os << fPx << " " << fPy << " " << fPz << " ";
*os << fDestep << " " << fTof;
+ *os << " " << fx0 << " " << fy0 << " " << fz0 << " ";
*os << endl;
os->flags(fmt); // reset back to old formating.
return;
*is >> fTrack >> fX >> fY >> fZ;
*is >> fStatus >> fLayer >> fLadder >> fDet >> fPx >> fPy >> fPz >>
fDestep >> fTof;
+ *is >> fx0 >> fy0 >> fz0;
return;
}
//----------------------------------------------------------------------
#include "AliHit.h"
#include <iostream.h>
+#include <TLorentzVector.h>
class TParticle;
// Float_t fZ; // defined in AliHit
public:
- AliITShit() {}// Default consrtructor
+ AliITShit();// Default consrtructor
+ // Old Standard Constructor
AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
+ // New Standard Constructor
+ AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof,
+ TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p);
+ // Default destructor
virtual ~AliITShit() {}
// Get Hit information functions.
// virtual int GetTrack() const {return fTrack;} // define in AliHit
// virtual void SetTrack(int track) const {fTrack=track;) // AliHit
virtual Int_t GetTrackStatus() const {//returns the status code
return fStatus;}
+ virtual Int_t GetTrackStatus0() const {//returns the status code
+ return fStatus0;}
virtual Int_t GetLayer() const {// returns the layer number
return fLayer;}
virtual Int_t GetLadder() const {// returns the ladder number
virtual Float_t GetZG()const {// Returns particle Z position at this hit
// in global coordinates.
return fZ;}
+ // Returns particle 3 position at this hit in global coordinates.
+ virtual void GetPositionG0(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
+ const {// returns the initial position in the Global frame and the
+ // time of flight
+ x=fx0;y=fy0;z=fz0,tof=fTof;return;};
virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z);
// Returns particle 3 position at this hit in local coordinates.
virtual void GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof);
Float_t fPz; // PZ of particle at the point of the hit
Float_t fDestep; // Energy deposited in the current step
Float_t fTof; // Time of flight at the point of the hit
+ Int_t fStatus0;// Track Status of Starting point
+ Float_t fx0; // Starting point of this step
+ Float_t fy0; // Starting point of this step
+ Float_t fz0; // Starting point of this step
+ Float_t ft0; // Starting point of this step
- ClassDef(AliITShit,1) //Hits object for set:ITS
+ ClassDef(AliITShit,2) //Hits object for set:ITS
};
// Input and output function for standard C++ input/output.
/*
$Log$
+Revision 1.12 2002/06/10 17:31:03 nilsen
+Replaced TArrayI expansion with Root version.
+
Revision 1.11 2002/06/04 18:43:15 nilsen
Fix to avoid divide by zero problem in MedianHitG and MedianHitL for track
that enter and exit the same side of a detector sensitive volume. Needed
(*fHitIndex)[fNhitsM-1] = h;
return fNhitsM;
}
-
-//___________________________________________________________________________
-void AliITSmodule::MedianHitG(Int_t index,
- Float_t hitx1,Float_t hity1,Float_t hitz1,
- Float_t hitx2,Float_t hity2,Float_t hitz2,
- Float_t &xMg, Float_t &yMg, Float_t &zMg){
- // median hit
- AliITSgeom *gm = fITS->GetITSgeom();
- Float_t x1l,y1l,z1l;
- Float_t x2l,y2l,z2l;
- Float_t xMl,yMl=0,zMl;
- Float_t l[3], g[3];
-
- g[0] = hitx1;
- g[1] = hity1;
- g[2] = hitz1;
- gm->GtoL(index,g,l);
- x1l = l[0];
- y1l = l[1];
- z1l = l[2];
-
- g[0] = hitx2;
- g[1] = hity2;
- g[2] = hitz2;
- gm->GtoL(index,g,l);
- x2l = l[0];
- y2l = l[1];
- z2l = l[2];
-
- // Modified by N.Carrer. In very rare occasions the track may be just
- // tangent to the module. Therefore the entrance and exit points have the
- // same y.
- if( (y2l-y1l) != 0.0 ) {
- xMl = (-y1l / (y2l-y1l))*(x2l-x1l) + x1l;
- zMl = (-y1l / (y2l-y1l))*(z2l-z1l) + z1l;
- } else {
- xMl = 0.5*(x1l+x2l);
- zMl = 0.5*(z1l+z2l);
- }
-
- l[0] = xMl;
- l[1] = yMl;
- l[2] = zMl;
- gm->LtoG(index,l,g);
- xMg = g[0];
- yMg = g[1];
- zMg = g[2];
-}
//___________________________________________________________________________
Double_t AliITSmodule::PathLength(Int_t index,AliITShit *itsHit1,
AliITShit *itsHit2){
// path length
static Float_t x0,y0,z0;
- if (status == 66){ // entering
+ if ((status&0x0002)!=0){ // entering
x0 = x;
y0 = y;
z0 = z;
dy1 = y-y1;
dz1 = z-z1;
nseg++;
- if (status == 68) flag = 0; //exiting
- else flag = 2; //inside
+ if ((status&0x0004)!=0) flag = 0; //exiting
+ if ((status&0x0001)!=0) flag = 2; // inside
+ else flag = 2; //inside ?
x0 = x;
y0 = y;
z0 = z;
track = h1->GetTrack();
return kTRUE;
}
+//______________________________________________________________________
+Bool_t AliITSmodule::MedianHitG(AliITShit *h1,AliITShit *h2,
+ Float_t &x,Float_t &y,Float_t &z){
+ // Computes the mean hit location for a set of hits that make up a track
+ // passing through a volume. Returns kFALSE untill the the track leaves
+ // the volume.
+ // median hit
+ AliITSgeom *gm = fITS->GetITSgeom();
+ Float_t x1l=0.,y1l=0.,z1l=0.;
+ Float_t x2l=0.,y2l=0.,z2l=0.;
+ Float_t xMl,yMl=0,zMl;
+ Float_t l[3], g[3];
+
+ h1->GetPositionG(x1l,y1l,z1l);
+ h2->GetPositionG(x2l,y2l,z2l);
+
+ // Modified by N.Carrer. In very rare occasions the track may be just
+ // tangent to the module. Therefore the entrance and exit points have the
+ // same y.
+ if( (y2l-y1l) != 0.0 ) {
+ xMl = (-y1l / (y2l-y1l))*(x2l-x1l) + x1l;
+ zMl = (-y1l / (y2l-y1l))*(z2l-z1l) + z1l;
+ } else {
+ xMl = 0.5*(x1l+x2l);
+ zMl = 0.5*(z1l+z2l);
+ }
+
+ l[0] = xMl;
+ l[1] = yMl;
+ l[2] = zMl;
+ gm->LtoG(h1->GetModule(),l,g);
+ x = g[0];
+ y = g[1];
+ z = g[2];
+ return kTRUE;
+}
+//___________________________________________________________________________
+void AliITSmodule::MedianHitG(Int_t index,
+ Float_t hitx1,Float_t hity1,Float_t hitz1,
+ Float_t hitx2,Float_t hity2,Float_t hitz2,
+ Float_t &xMg, Float_t &yMg, Float_t &zMg){
+ // median hit
+ AliITSgeom *gm = fITS->GetITSgeom();
+ Float_t x1l,y1l,z1l;
+ Float_t x2l,y2l,z2l;
+ Float_t xMl,yMl=0,zMl;
+ Float_t l[3], g[3];
+
+ g[0] = hitx1;
+ g[1] = hity1;
+ g[2] = hitz1;
+ gm->GtoL(index,g,l);
+ x1l = l[0];
+ y1l = l[1];
+ z1l = l[2];
+
+ g[0] = hitx2;
+ g[1] = hity2;
+ g[2] = hitz2;
+ gm->GtoL(index,g,l);
+ x2l = l[0];
+ y2l = l[1];
+ z2l = l[2];
+
+ // Modified by N.Carrer. In very rare occasions the track may be just
+ // tangent to the module. Therefore the entrance and exit points have the
+ // same y.
+ if( (y2l-y1l) != 0.0 ) {
+ xMl = (-y1l / (y2l-y1l))*(x2l-x1l) + x1l;
+ zMl = (-y1l / (y2l-y1l))*(z2l-z1l) + z1l;
+ } else {
+ xMl = 0.5*(x1l+x2l);
+ zMl = 0.5*(z1l+z2l);
+ }
+
+ l[0] = xMl;
+ l[1] = yMl;
+ l[2] = zMl;
+ gm->LtoG(index,l,g);
+ xMg = g[0];
+ yMg = g[1];
+ zMg = g[2];
+}
//___________________________________________________________________________
-void AliITSmodule::MedianHitL(Int_t index,
- AliITShit *itsHit1,
+Bool_t AliITSmodule::MedianHitL( AliITShit *itsHit1,
AliITShit *itsHit2,
Float_t &xMl, Float_t &yMl, Float_t &zMl){
// median hit
xMl = 0.5*(x1l+x2l);
zMl = 0.5*(z1l+z2l);
}
+ return kTRUE;
}
//___________________________________________________________________________
void AliITSmodule::MedianHit(Int_t index,
// median hit
static Float_t x1,y1,z1;
- if (status == 66){ // entering
+ if ((status&0x0002)!=0){ // entering
x1 = xg;
y1 = yg;
z1 = zg;
flag = 1;
- } // end if
- if (status == 68){ // exiting
+ } else if ((status&0x0004)!=0){ // exiting
MedianHitG(index,x1,y1,z1,xg,yg,zg,xMg,yMg,zMg);
flag = 0;
} // end if
- if ((status != 66) && (status != 68)) flag = 1;
+ else flag = 1;
}
//___________________________________________________________________________
void AliITSmodule::GetID(Int_t &lay,Int_t &lad,Int_t &det){
// Adds pointer of hit belonging to this module
// and returns number of hits in this module
Int_t AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
+ Int_t GetHitTrackIndex(Int_t i) {// get hit track index
+ return fTrackIndex->At(i);}
+ Int_t GetHitHitIndex(Int_t i) {
+ // return the hit index number in TreeH for the given sorted hit in
+ // the module.
+ return fHitIndex->At(i);}
+ void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
+ // return the hit index number for the given hit. Hits are kept on
+ // file according to their track index and hit index numbers.
+ TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);}
+ // Computes mean global location from hits that make up a track passing
+ // through a volume.
+ Bool_t MedianHitG(AliITShit *h1,AliITShit *h2,
+ Float_t &x,Float_t &y,Float_t &z);
void MedianHitG(Int_t index, Float_t hitx1,Float_t hity1,Float_t hitz1,
Float_t hitx2,Float_t hity2,Float_t hitz2, Float_t &xMg,
Float_t &yMg, Float_t &zMg);
+ // Computes mean local location from hits that make up a track passing
+ // through a volume.
+ Bool_t MedianHitL(AliITShit *h1,AliITShit *h2,
+ Float_t &x,Float_t &y,Float_t &z);
void MedianHitL(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2,
Float_t &xMl, Float_t &yMl, Float_t &zMl);
Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2);
- Int_t GetHitTrackIndex(Int_t i) {
- // get hit track index
- return fTrackIndex->At(i);
- }
- Int_t GetHitHitIndex(Int_t i) {
- // return the hit index number in TreeH for the given sorted hit in the module.
- return fHitIndex->At(i);
- }
- void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
- // return the hit index number for the given hit. Hits are kept on
- // file according to their track index and hit index numbers.
- TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);
- }
// returns both the track and hit index numbers for the given hit. Hits
// are kept on file according to their track index and hit index numbers.
void MedianHit(Int_t index, Float_t xg,Float_t yg,Float_t zg,