CMCServer.h
//-----------------------------------------------------------------------------
// $Header: /asis/offline/ceres/cool/project/RCS/CMCServer.h,v 2.6 1997/06/30 18:20:06 lenkeit Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// CMCServer is a class to collect the pointers to the MC info.
// The list of particles from label MCHP (80048) is created in update(),
// the CMCDigiHits are created in the digitize() functions of the detectors,
// and their pointers are added to the list maintained here. This is mainly
// for convenience when accessing the MC info.
//
// Declaration of class CMCServer.
//
//-----------------------------------------------------------------------------
#ifndef CMCSERVER_H
#define CMCSERVER_H
#include "cool.h"
#include "CMCcool.h"
#include "CEventServer.h"
#include "CVertex.h"
#include "CMCServerSetup.h"
#include "CMCDigiHit.h"
#include "CMCParticle.h"
#include "CMCGeantTrack.h"
#include "rw/tpordvec.h"
#define C_SETUPFILE_MCSERVER "setup.mcserver"
class CPadChamber;
class CSidc1;
class CSidc2;
class CMCServer {
public:
CMCServer(const char* = 0);
~CMCServer();
public:
void resetTracksAndHits();
CBoolean update(CEventServer&); // updates all MC info from labels.
CBoolean loadEventWithCloseVertex(CEventServer&, CVertex*); // ... requiring match in vertex-z
CBoolean alignGeantHitsToVertex(CVertex&, CVertex&, CSidc1&, CSidc2&, CPadChamber&); // aligns Geant Sidc Hits to data vertex, for overlay mode
// to allow people to create their own digiHits (eg. for bgnd...) and add them to the list...
// take care about your own 'particle' list for these hits !!!!!!!
inline void addMCDigiHit(CDetector::CDetectorId detId, CMCDigiHit* digiHit) { digiHits[detId].insert(digiHit); }
// get info about the origin of the primary interaction
CVertex* getMCVertex();
CVertex* getMCADDeVertex();
CVertex* getMCVertexFromUserLabel(CEventServer&);
void listSetup(ostream& = cout) const; // list current trigger setup
CMCServerSetup* getSetup() const { return setup; }
public:
inline const RWTPtrOrderedVector<CMCGeantTrack>* getMCGeantTracks() const { return &geantTracks; }
inline const RWTPtrOrderedVector<CMCDigiHit>* getMCDigiHits(int detId) const { return &digiHits[detId]; }
float getWeight(CEventServer &) const;
int getDecayMode(CEventServer &) const;
public:
void listGeantTracks(ostream& = cout);
public:
inline void setPrintLevel(int val) { printon = val; }
protected: // copy and assignment operators do not make sense for this class
CMCServer(const CMCServer &);
CMCServer & operator = (const CMCServer &);
protected:
CBoolean unpack(CEventServer&); // updates all MC info from labels.
int *giveDataPointer(CEventServer&, int); // utility to return pointer to data for label
protected:
int indexOfLastTrack;
RWTPtrOrderedVector<CMCGeantTrack> geantTracks;
RWTPtrOrderedVector<CMCDigiHit> digiHits[MaxDetectors]; // MC hits as 'made' by the detectors
CVertex* mcvertex;
CVertex* mcADDevertex;
CMCServerSetup *setup;
private:
int printon;
};
#endif /* CMCSERVER_H */