ROOT logo
HYDRA - THE HADES ANALYSIS PACKAGE » (UNKNOWN) » HParticleMetaMatcher

class HParticleMetaMatcher: public HReconstructor

_HADES_CLASS_DESCRIPTION


  HParticleMetamatcher


 usage :
 Int_t loopDST_task(
		   TString infileList="/lustre/hebe/hades/dst/mar19/gen2/ag158ag/3200A/083/root/be1908311041501.hld_dst_mar19.root",
		   TString outfile="test.root",Int_t nEvents=50)
{
    HLoop loop(kTRUE);

    //-------------------------------------------------
    if(1){
	TString beamtime="mar19";

	Int_t mdcMods[6][4]=
	{ {1,1,1,1},
	{1,1,1,1},
	{1,1,1,1},
	{1,1,1,1},
	{1,1,1,1},
	{1,1,1,1} };
	TString asciiParFile     = "";
	TString rootParFile      = "/cvmfs/hades.gsi.de/param/real/mar19/allParam_Mar19_gen2_18102019.root";
	TString paramSource      = "root"; // root, ascii, oracle
	TString paramrelease     = "MAR19_dst_gen3";  // now, APR12_gen2_dst APR12_gen5_dst
	HDst::setupSpectrometer(beamtime,mdcMods,"rich,mdc,tof,rpc,emc,wall,start,tbox");
	HDst::setupParameterSources(paramSource,asciiParFile,rootParFile,paramrelease);  // now, APR12_gen2_dst
    }
    //-------------------------------------------------

    Bool_t ret =kFALSE;
    if(infileList.Contains(",")){
	ret = loop.addMultFiles(infileList);      // file1,file2,file3
    } else{
	ret = loop.addFiles(infileList); // myroot*.root
    }

    if(ret == 0) {
	cout<<"READBACK: ERROR : cannot find inputfiles : "<<infileList.Data()<<endl;
	return 1;
    }

    if(!loop.setInput("")) {   // all input categories
	cout<<"READBACK: ERROR : cannot read input !"<<endl;
	exit(1);
    } // read all categories
    loop.printCategories();
    loop.printChain();

    HCategory* candCat    = (HCategory*)HCategoryManager::getCategory(catParticleCand);
    HCategory* evtInfoCat = (HCategory*)HCategoryManager::getCategory(catParticleEvtInfo);


    //-------------------------------------------------
    // added for the task
    HTaskSet *masterTaskSet = gHades->getTaskSet("all");
    HParticleMetaMatcher* matcher = new HParticleMetaMatcher();
    matcher->setDebug();  // print infos to screen
    masterTaskSet->add(matcher);
    //-------------------------------------------------

    Int_t entries = loop.getEntries();
    if(nEvents < entries && nEvents >= 0 ) entries = nEvents;

    for (Int_t i = 0; i < entries; i++) {
	Int_t nbytes =  loop.nextEvent(i);             // get next event. categories will be cleared before
	if(nbytes <= 0) { cout<<nbytes<<endl; break; } // last event reached
	if(i%1000 == 0) cout<<"event "<<i<<endl;

	HParticleEvtInfo* evtInfo=0;
	evtInfo = HCategoryManager::getObject(evtInfo,evtInfoCat,0 );

	if(evtInfo&&!evtInfo->isGoodEvent(Particle::kGoodTRIGGER|          // standard event selection apr12
					  Particle::kGoodVertexClust|
					  Particle::kGoodVertexCand|
					  Particle::kGoodSTART|
					  Particle::kNoPileUpSTART|
					  Particle::kNoVETO|
					  Particle::kGoodSTARTVETO|
					  Particle::kGoodSTARTMETA
					 )) continue;

	if(candCat){

	    Int_t size = candCat->getEntries();
	    HParticleCand* cand=0;

	    for(Int_t j = 0; j < size; j++) {
		cand = HCategoryManager::getObject(cand,candCat,j);
		if(cand) {
		    if(!cand->isFlagBit(kIsUsed)) { continue; }           // skip particles rejected by HParticleTrackSorter

		    if(cand->isRpcClstUsed()){
		        const HRpcCluster* rpc = matcher->recalcRpc(cand); // reconstruct the rpchit from tracking +rk dx dy

			Int_t s,col0,col1,cell0,cell1;
                      HGeomVector hit0,hit1;
			matcher->predictRpcCell(cand,hit0,hit1,s,col0,cell0,col1,cell1); // which rpc cell should this track fire?
		    }
		    if(0&&(cand->isTofClstUsed() || cand->isTofHitUsed()) ){
			const HTofCluster* tof = matcher->recalcTof(cand);
			Int_t s,mod0,mod1,cell0,cell1;
                      HGeomVector hit0,hit1;
			matcher->predictTofCell(cand,hit0,hit1,s,mod0,cell0,mod1,cell1); // which Tof cell should this track fire?
		    }
		    if(0&&cand->getEmcInd()>-1){
       	        const HEmcCluster* emc = matcher->recalcEmc(cand);
			Int_t s,pos,cell;
			HGeomVector hit;
                      vector<Int_t> vcells;
			matcher->predictEmcCell(cand,hit,s,pos,cell); // which emc cell should this track fire?
		    }
		}
	    } // end cand loop
	} // end cand cat
    } // end eventloop

    //-------------------------------------------------
    // added for the task
    if(gHades)gHades->finalizeTasks();
    //-------------------------------------------------

    delete gHades;
    return 0;
}


Function Members (Methods)

public:
HParticleMetaMatcher(const Text_t* name = "HParticleMetaMatcher", const Text_t* title = "HParticleMetaMatcher")
virtual~HParticleMetaMatcher()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidHReconstructor::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual Bool_tHReconstructor::connectTask(HTask* task, Int_t n = 0)
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual Int_texecute()
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual Bool_tfinalize()
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual HTask*HReconstructor::getComposite()
virtual voidHReconstructor::getConnections()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
voidgetEmcCellArray(Int_t s, Int_t cell, vector<Int_t>& vcells)
const HGeomVector*getEmcCellGeom(Int_t s, Int_t cell)
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual HTask*HTask::getOwner()
const HGeomVector*getRpcCellGeom(Int_t s, Int_t col, Int_t cell)
TObjArrayHReconstructor::getTable()
virtual HTask*HReconstructor::getTask(const Char_t* name)
virtual const char*TNamed::GetTitle() const
const HGeomVector*getTofCellGeom(Int_t s, Int_t mod, Int_t cell)
const HGeomVector&getTrackMetaLab()
const HGeomVector&getTrackMetaMod()
const HGeomVector&getTrackMetaSec()
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual Bool_tinit()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tHReconstructor::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual voidHReconstructor::isTimed(Bool_t flag = kTRUE)
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual HTask*HReconstructor::next(Int_t& errCode)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
HTask&HTask::operator=(const HTask&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
Bool_tpredictEmcCell(HParticleCand* cand, HGeomVector& hit, Int_t& s, Int_t& pos, Int_t& cell)
Bool_tpredictRpcCell(HParticleCand* cand, HGeomVector& hit1, HGeomVector& hit2, Int_t& s, Int_t& col1, Int_t& cell1, Int_t& col2, Int_t& cell2)
Bool_tpredictTofCell(HParticleCand* cand, HGeomVector& hit0, HGeomVector& hit1, Int_t& s, Int_t& mod0, Int_t& cell0, Int_t& mod1, Int_t& cell1)
virtual voidTNamed::Print(Option_t* option = "") const
virtual voidHReconstructor::printTimer()
virtual Int_tTObject::Read(const char* name)
const HEmcCluster*recalcEmc(HParticleCand* cand)
const HRpcCluster*recalcRpc(HParticleCand* cand)
const HTofCluster*recalcTof(HParticleCand* cand)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual Bool_treinit()
voidTObject::ResetBit(UInt_t f)
virtual voidHReconstructor::resetTimer()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidHReconstructor::setActive(Bool_t state)MENU
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual Bool_tHTask::setConnections()
voidsetDebug(Bool_t debug = kTRUE)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidHTask::setManual()
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidHTask::setOwner(HTask* atask)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
voidcalcSegPoints(TVector3& p1, TVector3& p2, Double_t phiseg, Double_t thetaseg, Double_t roseg, Double_t zseg)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Bool_tfindIntersectionLinePlane(TVector3& pointIntersect, const TVector3& pos, const TVector3& dir, const TVector3& planeCenter, const TVector3& planeNormal)
Bool_tisInEmcCell(HGeomVector& vmod, Int_t s, Int_t c)
Bool_tisInRpcCell(HGeomVector& vmod, Int_t s, Int_t col, Int_t c)
Bool_tisInTofCell(HGeomVector& vmod, Int_t s, Int_t col, Int_t c)
voidTObject::MakeZombie()
Bool_ttraceToMeta(const HParticleCand* cand, TVector3& metaHit, const TVector3& metaCenter, const TVector3& metaNorm)

Data Members

protected:
Float_tDPlanesRpc! RPC displacement for collumns
HGeomVectorcellEMC[6][163][4]! [sec][cell] 4points
HGeomVectorcellRPC[6][6][31][4]! [sec][col][cell] 4points
HGeomVectorcellTOF[6][8][8][4]! [sec][mod][cell] 4points
TVector3centerVecEmc[6]! [sec] center vector on the Emc module in the sector coordinate system
TVector3centerVecRpc[6][3]! [sec][plane col{0,2,4}, {1,3,5}, mid] center vector on the RPC module in the sector coordinate system
TVector3centerVecTof[6][8]! [sec][mod] center vector on each Tof module in the sector coordinate system
HEmcClusteremccluster!
Bool_tHReconstructor::fActiveActive flag
HCategory*fCatEmcCluster! pointer to the Emc cluster category
HCategory*fCatRpcCluster! pointer to the Rpc cluster category.
HCategory*fCatTofCluster! pointer to the Tof cluster category
HCategory*fCatTofHit! pointer to the Tof hit category
Bool_tfDebug! switch print on/off
HEmcGeomPar*fEmcGeometry! Emc geometry
TList*HReconstructor::fHistogramsList of histograms generated by this reconstructor.
Bool_tHTask::fIsTimedtimer flag
TStringTNamed::fNameobject identifier
TObjArrayHReconstructor::fOutputs
HRpcGeomPar*fRpcGeometry! Rpc geometry
TStopwatchHReconstructor::fTimerTask timer
TStringTNamed::fTitleobject title
HTofGeomPar*fTofGeometry! TOF geometry
Bool_tHTask::isConnected
Bool_tHTask::isInitialised
HGeomTransformlabSecTrans[6]! [sec]
Bool_tHTask::manual
HGeomTransformmodSecTransEmc[6]! [sec]
HGeomTransformmodSecTransRpc[6]! [sec]
HGeomTransformmodSecTransTof[6][8]! [sec][mod]
TVector3normVecEmc[6]! [sec] normal vector on the Emc module in the sector coordinate system
TVector3normVecRpc[6][3]! [sec][plane col{0,2,4}, {1,3,5}, mid] normal vector on the RPC module in the sector coordinate system
TVector3normVecTof[6][8]! [sec][mod] normal vector on each Tof module in the sector coordinate system
HTask*HTask::owner
HRpcGeomCellPar*pGeomCellPar! Rpc cell info
HSpecGeomPar*pSpecGeomPar! sector lab trans
HRpcClusterrpccluster!
HTofClustertofcluster!
HGeomVectortrackMetaLab!
HGeomVectortrackMetaMod!
HGeomVectortrackMetaSec!

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HParticleMetaMatcher(const Text_t* name = "HParticleMetaMatcher", const Text_t* title = "HParticleMetaMatcher")
const HGeomVector* getRpcCellGeom(Int_t s, Int_t col, Int_t cell)
 returns null pointer if s,col,cell are invalid
 returns HGeomVector* to first element of array of 4 HGeomVectors
 for the shape of the cell in mod sys
const HGeomVector* getTofCellGeom(Int_t s, Int_t mod, Int_t cell)
 returns null pointer if s,mod,cell are invalid
 returns HGeomVector* to first element of array of 4 HGeomVectors
 for the shape of the cell in mod sys
const HGeomVector* getEmcCellGeom(Int_t s, Int_t cell)
 returns null pointer if s,cell are invalid
 returns HGeomVector* to first element of array of 4 HGeomVectors
 for the shape of the cell in mod sys
void calcSegPoints(TVector3& p1, TVector3& p2, Double_t phiseg, Double_t thetaseg, Double_t roseg, Double_t zseg)
 in sector sys : calc p1 p2 points (not MDC Hit!) on MdcSeg
Bool_t findIntersectionLinePlane(TVector3& pointIntersect, const TVector3& pos, const TVector3& dir, const TVector3& planeCenter, const TVector3& planeNormal)
 Finds the intersection point of a straight line with any plane.
 pointIntersect: the intersection point (return value).
 pos:            a point on the straight line.
 dir:            direction of the straight line.
 planeCenter:    a point on the plane.
 planeNormal:    normal vector of the plane.
Bool_t traceToMeta(const HParticleCand* cand, TVector3& metaHit, const TVector3& metaCenter, const TVector3& metaNorm)
 calculate intersection of outer MdcSeg (RK) straightline with META plane
 in sector sys
Bool_t isInRpcCell(HGeomVector& vmod, Int_t s, Int_t col, Int_t c)
  check if vmodule (mod system) is inside cell (2D) Trapez

       p1---------------p2
b\
\
        p0-------------p3
              a

 checks if HGeomVector* vmodule
Bool_t isInEmcCell(HGeomVector& vmod, Int_t s, Int_t c)
Bool_t isInTofCell(HGeomVector& vmod, Int_t s, Int_t col, Int_t c)
void getEmcCellArray(Int_t s, Int_t cell, vector<Int_t>& vcells)
 returns neighbour cell indices for a given cell
 in the order

  0   1    2
  3   4(cell) 5
  6   7    8
  into vcells (-1 if cell does not exist)
Bool_t init()
 Get categories and coordinate transformations.
 Call this after HADES has been initialized.
Bool_t reinit()
const HRpcCluster* recalcRpc(HParticleCand* cand)
 returns HRpcCluster pointer to an object owned by HParticleMetaMatcher
 which has been reconstructed from an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane. The original META
 hit position can be restorded using RK dx, dy from HParticleCand.
 Works for candidates which have cand->isRpcClstUsed() set.
 The hit point of RK on the META plane can be retrieved by
 calling
 const HGeomVector&  getTrackMetaMod()
 const HGeomVector&  getTrackMetaSec()
 const HGeomVector&  getTrackMetaLab()
 directly after calling this function.
const HTofCluster* recalcTof(HParticleCand* cand)
 returns HTofCluster pointer to an object owned by HParticleMetaMatcher
 which has been reconstructed from an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane. The original META
 hit position can be restorded using RK dx, dy from HParticleCand.
 Works for candidates which have cand->isTofClstUsed() or cand->isTofHitUsed() set.
 The hit point of RK on the META plane can be retrieved by
 calling
 const HGeomVector&  getTrackMetaMod()
 const HGeomVector&  getTrackMetaSec()
 const HGeomVector&  getTrackMetaLab()
 directly after calling this function.
const HEmcCluster* recalcEmc(HParticleCand* cand)
 returns HEmcCluster pointer to an object owned by HParticleMetaMatcher
 which has been reconstructed from an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane. The original META
 hit position can be restorded using RK dx dy from HParticleCand.
 Works for candidates which have cand->getEmcInd()!=-1 set.
 The hit point of RK on the META plane can be retrieved by
 calling
 const HGeomVector&  getTrackMetaMod()
 const HGeomVector&  getTrackMetaSec()
 const HGeomVector&  getTrackMetaLab()
 directly after calling this function.

Bool_t predictRpcCell(HParticleCand* cand, HGeomVector& hit1, HGeomVector& hit2, Int_t& s, Int_t& col1, Int_t& cell1, Int_t& col2, Int_t& cell2)
 Reconstructs an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane.
 2 hits (hit0,hit2) on the Rpc planes of column (0,2,4)
 and (1,3,5). Possible hit RPC cells are returned
 by coordinates sector, (col0,cell0) (col1,cell1).
 colX and cellX are -1 if no cell has been hit on this plane.
 Works with all candidates which provide outer segments.
Bool_t predictTofCell(HParticleCand* cand, HGeomVector& hit0, HGeomVector& hit1, Int_t& s, Int_t& mod0, Int_t& cell0, Int_t& mod1, Int_t& cell1)
 Reconstructs an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane.
 2 hits (hit0,hit2) on the TOF module planes cand be
 returned. Possible hit TOF cells are returned
 by coordinates sector, (mod0,cell0) (mod1,cell1).
 colX and cellX are -1 if no cell has been hit on this plane.
 The hit points will be 0,0,0 in this case.
 Works with all candidates which provide outer segments.
Bool_t predictEmcCell(HParticleCand* cand, HGeomVector& hit, Int_t& s, Int_t& pos, Int_t& cell)
 Reconstructs an intersection of HParticleCand outer
 segment of Runge Kutta with the META detector plane.
 1 hit on the EMC plane can be returned.
 The possible hit cell returned  by coordinates sector, pos (0-162) , cell (0,254).
 pos and cell are -1 if no cell has been hit on this plane.
 Works with all candidates which provide outer segments.
virtual ~HParticleMetaMatcher()
{ ; }
void setDebug(Bool_t debug = kTRUE)
{fDebug = debug;}
const HGeomVector& getTrackMetaMod()
{ return trackMetaMod;}
const HGeomVector& getTrackMetaSec()
{ return trackMetaSec;}
const HGeomVector& getTrackMetaLab()
{ return trackMetaLab;}
Int_t execute()
{ return 0; }
Bool_t finalize()
{ return kTRUE; }