Origin: marian.ivanov@cern.ch
Container classes with MC infomation
+The AliMCInfo contains the information about the particles properties
+during transportation throuch ALICE Detector
+
+The base Information :
+TParticle - fParticle - properties of the particle at creation point
+AliTrackReference - fXXXRefernces - TClonesArray of refernces in differnt detectors
+fNXXXRef - number of the track refernces in differnt detectors
+AliTPCdigitRow - fTPCRow - the map of the hitted rows - (will be repalced by TBits)
+fRowsWith* - number of rows hitted by particle
+fMCtracks - - number of turn over of the track inside of the TPC
+
+++++
+some additional information usable for tree draw - TO SPEED UP tree queries
+IMPORTANT FOR PROOF FAST PROTOTYPING ANALYSIS
+
+
+
+
*/
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <stdio.h>
-#include <string.h>
//ROOT includes
-#include "TROOT.h"
#include "Rtypes.h"
-#include "TFile.h"
-#include "TTree.h"
-#include "TChain.h"
-#include "TCut.h"
-#include "TString.h"
-#include "TStopwatch.h"
-#include "TParticle.h"
-#include "TSystem.h"
-#include "TCanvas.h"
-#include "TGeometry.h"
-#include "TPolyLine3D.h"
-
+#include "TClonesArray.h"
//ALIROOT includes
-#include "AliRun.h"
-#include "AliStack.h"
-#include "AliSimDigits.h"
-#include "AliTPCParam.h"
-#include "AliTPC.h"
-#include "AliTPCLoader.h"
-#include "AliDetector.h"
#include "AliTrackReference.h"
-#include "AliTPCParamSR.h"
-#include "AliTracker.h"
-#include "AliMagF.h"
-#include "AliHelix.h"
-#include "AliTrackPointArray.h"
-
-#endif
#include "AliMCInfo.h"
+#endif
+
//
//
fRowsWithDigitsInn(0),
fRowsWithDigits(0),
fRowsTrackLength(0),
+ fTPCtrackLength(-1),
fPrim(0),
fTPCRow(),
fNTPCRef(0), // tpc references counter
fTRDReferences(0),
fTOFReferences(0)
{
+ //
+ // Default constructor
+ //
fTPCReferences = new TClonesArray("AliTrackReference",10);
fITSReferences = new TClonesArray("AliTrackReference",10);
fTRDReferences = new TClonesArray("AliTrackReference",10);
fRowsWithDigitsInn(info.fRowsWithDigitsInn),
fRowsWithDigits(info.fRowsWithDigits),
fRowsTrackLength(info.fRowsTrackLength),
+ fTPCtrackLength(info.fTPCtrackLength),
fPrim(info.fPrim),
fTPCRow(info.fTPCRow),
fNTPCRef(info.fNTPCRef), // tpc references counter
fTRDReferences(0),
fTOFReferences(0)
{
+ //
+ // copy constructor
+ //
fTPCReferences = (TClonesArray*)info.fTPCReferences->Clone();
fITSReferences = (TClonesArray*)info.fITSReferences->Clone();
fTRDReferences = (TClonesArray*)info.fTRDReferences->Clone();
}
+AliMCInfo& AliMCInfo::operator=(const AliMCInfo& info) {
+ //
+ // Assignment operator
+ //
+ this->~AliMCInfo();
+ new (this) AliMCInfo(info);
+ return *this;
+}
+
+
AliMCInfo::~AliMCInfo()
{
+ //
+ // Destructor of the class
+ //
if (fTPCReferences) {
delete fTPCReferences;
}
void AliMCInfo::Update()
{
+ //
+ // Update MC info
+ // Calculates some derived variables
//
//
fMCtracks =1;
- if (!fTPCReferences) {
- fNTPCRef =0;
- return;
- }
- Float_t direction=1;
- //Float_t rlast=0;
- fNTPCRef = fTPCReferences->GetEntriesFast();
- fNITSRef = fITSReferences->GetEntriesFast();
- fNTRDRef = fTRDReferences->GetEntriesFast();
- fNTOFRef = fTOFReferences->GetEntriesFast();
-
- for (Int_t iref =0;iref<fTPCReferences->GetEntriesFast();iref++){
- AliTrackReference * ref = (AliTrackReference *) fTPCReferences->At(iref);
- //Float_t r = (ref->X()*ref->X()+ref->Y()*ref->Y());
- Float_t newdirection = ref->X()*ref->Px()+ref->Y()*ref->Py(); //inside or outside
- if (iref==0) direction = newdirection;
- if ( newdirection*direction<0){
- //changed direction
- direction = newdirection;
- fMCtracks+=1;
- }
- //rlast=r;
- }
//
// decay info
fTPCdecay=kFALSE;
////////////////////////////////////////////////////////////////////////
AliTPCdigitRow & AliTPCdigitRow::operator=(const AliTPCdigitRow &digOld)
{
- for (Int_t i = 0; i<kgRowBytes; i++) fDig[i] = digOld.fDig[i];
+ for (Int_t i = 0; i<32; i++) fDig[i] = digOld.fDig[i];
return (*this);
}
////////////////////////////////////////////////////////////////////////
void AliTPCdigitRow::SetRow(Int_t row)
{
- if (row >= 8*kgRowBytes) {
- cerr<<"AliTPCdigitRow::SetRow: index "<<row<<" out of bounds."<<endl;
+ //
+ // set bit mask for given row
+ //
+ if (row >= 8*32) {
+ // cerr<<"AliTPCdigitRow::SetRow: index "<<row<<" out of bounds."<<endl;
return;
}
Int_t iC = row/8;
// count only rows less equal row number upto
//
Int_t total = 0;
- for (Int_t i = 0; i<kgRowBytes; i++) {
+ for (Int_t i = 0; i<32; i++) {
for (Int_t j = 0; j < 8; j++) {
if (i*8+j > upto) return total;
if (TESTBIT(fDig[i],j)) total++;
//
// resets all rows to zero
//
- for (Int_t i = 0; i<kgRowBytes; i++) {
+ for (Int_t i = 0; i<32; i++) {
fDig[i] <<= 8;
}
}
// returns the last row number with a digit
// returns -1 if now digits
//
- for (Int_t i = kgRowBytes-1; i>=0; i--) {
+ for (Int_t i = 32-1; i>=0; i--) {
for (Int_t j = 7; j >= 0; j--) {
if TESTBIT(fDig[i],j) return i*8+j;
}
// returns the first row number with a digit
// returns -1 if now digits
//
- for (Int_t i = 0; i<kgRowBytes; i++) {
+ for (Int_t i = 0; i<32; i++) {
for (Int_t j = 0; j < 8; j++) {
if (TESTBIT(fDig[i],j)) return i*8+j;
}
return ((Float_t)((kp2-aa-bb)*kp1/aa));
}
+
+void AliMCInfo::CalcTPCrows(TClonesArray * runArrayTR){
+ //
+ // Calculates the numebr of the track references for detectors
+ // In case of changing direction - curling tracks - the counter is not increasing
+ //
+ // Rough calculation
+ // of the first and last point in the TPC
+ //
+ fNTPCRef = 0;
+ fNITSRef = 0;
+ fNTRDRef = 0;
+ fNTOFRef = 0;
+ Float_t tpcminRadius=250;
+ Float_t tpcmaxRadius=80;
+ Float_t dir=0;
+ Int_t nover=0;
+
+ for (Int_t iTrackRef = 0; iTrackRef < runArrayTR->GetEntriesFast(); iTrackRef++) {
+ //
+ AliTrackReference *ref = (AliTrackReference*)runArrayTR->At(iTrackRef);
+ Float_t newdirection = (ref->X()*ref->Px()+ref->Y()*ref->Py()>0)? 1.:-1.; //inside or outside
+ if (dir*newdirection<0.5) {
+ nover++;
+ dir = newdirection;
+ }
+ //
+ if (ref->DetectorId()== AliTrackReference::kTRD){
+ tpcmaxRadius =250;
+ fNTRDRef++;
+ }
+ if (ref->DetectorId()== AliTrackReference::kITS){
+ fNITSRef++;
+ tpcminRadius =90;
+ }
+ if (ref->DetectorId()== AliTrackReference::kITS){
+ fNTOFRef++;
+ tpcmaxRadius =250;
+ }
+ //
+ if (ref->DetectorId()== AliTrackReference::kTPC){
+ fNTPCRef++;
+ if (ref->R()>tpcmaxRadius) tpcmaxRadius = ref->R();
+ if (ref->R()<tpcminRadius) tpcminRadius = ref->R();
+ }
+ if (ref->DetectorId()== AliTrackReference::kDisappeared){
+ if (TMath::Abs(ref->Z())<250 && TMath::Abs(ref->R()<250))
+ tpcmaxRadius = ref->R();
+ }
+ }
+ fTPCtrackLength = tpcmaxRadius-tpcminRadius;
+ fMCtracks=nover;
+}