StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
StFcsDb Class Reference
Inheritance diagram for StFcsDb:
TDataSet

Public Types

enum  GAINMODE { FIXED, DB, FORCED, TXT }
 get the pres valley position for cut
 
- Public Types inherited from TDataSet
enum  EDataSetPass {
  kContinue, kPrune, kStop, kUp,
  kStruct, kAll, kRefs, kMarked
}
 
enum  ESetBits { kMark = BIT(22), kArray = BIT(20) }
 
enum  EBitOpt { kSet = kTRUE, kReset = kFALSE }
 

Public Member Functions

 StFcsDb (const char *name="fcsDb")
 
int Init ()
 
int InitRun (int runNumber)
 
void setDebug (int v=1)
 
void setDbAccess (int v=1)
 debug level
 
void setRun (int run)
 enable(1) or disable(0) offline DB access
 
void setRun19 (int v=1)
 set run#
 
void setLeakyHcal (int v=1)
 set run19 geometry, otherwise final run21
 
void setEtGainMode (int v=0)
 set leaky Hcal
 
void setFcsDetectorPosition (fcsDetectorPosition_st *t)
 set Et Gain Setting 0=Auto from run#, 1=Old, 2=New(23027048) More...
 
void setFcsEcalGain (fcsEcalGain_st *)
 set fcsDetectorPosition_st*
 
void setFcsHcalGain (fcsHcalGain_st *)
 set fcsEcalGain_st*
 
void setFcsPresGain (fcsPresGain_st *)
 set fcsHcalGain_st*
 
void setFcsEcalGainCorr (fcsEcalGainCorr_st *)
 set fcsPresGain_st*
 
void setFcsHcalGainCorr (fcsHcalGainCorr_st *)
 set fcsEcalGainCorr_st*
 
void setFcsPresValley (fcsPresValley_st *)
 set fcsHcalGainCorr_st*
 
void setFcsEcalGainOnline (fcsEcalGainOnline_st *)
 set fcsPresValley_st*
 
void setFcsHcalGainOnline (fcsHcalGainOnline_st *)
 set fcsEcalGainOnline_st*
 
void setFcsPresThreshold (fcsPresThreshold_st *)
 set fcsHcalGainOnline_st*
 
int maxDetectorId () const
 set fcsPresThreshold_st* More...
 
int detectorId (int eh, int ns) const
 6
 
int ecalHcalPres (int det) const
 Ecal North=0, Ecal South=1, Hcal North=2, Hcal South=3, Pres=4/5.
 
int northSouth (int det) const
 Ecal=0, Hcal=1, Pres=2.
 
int nRow (int det) const
 north or south side
 
int nColumn (int det) const
 number of rows
 
int maxId (int det) const
 number of column
 
int getRowNumber (int det, int id) const
 maximum number of id
 
int getColumnNumber (int det, int id) const
 get the row number for the channel
 
int getId (int det, int row, int col) const
 get the column number for the channel
 
int getDepCh (int dep, int ch) const
 get the id from row/col
 
void getName (int det, int id, char name[])
 get the DEP/ch id
 
void getName (int ehp, int ns, int dep, int ch, char name[])
 Get Name of a channel.
 
StThreeVectorD getDetectorOffset (int det, double zdepth=-1) const
 Utility functions related to DetectorPosition. More...
 
StThreeVectorD getNormal (int det) const
 
float getDetectorAngle (int det) const
 This is the vector normal to the detector plane.
 
float getXWidth (int det) const
 get the angle of the detector
 
float getYWidth (int det) const
 get the X width of the cell
 
float getZDepth (int det) const
 get the Y width of the cell
 
float getShowerMaxZ (int det) const
 
void getLocalXYinCell (StFcsHit *hit, float &x, float &y) const
 getting XY in local cell coordinate More...
 
void getLocalXYinCell (int det, int id, float &x, float &y) const
 
void getLocalXYinCell (int det, int col, int row, float &x, float &y) const
 
StThreeVectorD getStarXYZ (int det, float FcsX, float FcsY, float FcsZ=-1.0, float zVertex=0.0) const
 get the STAR frame cooridnates from local XYZ [cm] More...
 
float getPhi (int det, float FcsX, float FcsY, float FcsZ=-1.0) const
 get the STAR frame phi angle from from local X/Y [cm]
 
float getEta (int det, float FcsX, float FcsY, float FcsZ=-1.0, float zVertex=0.0) const
 get the STAR frame pseudo rapidity from the vertex from local X/Y [cm]
 
StThreeVectorD getStarXYZfromColumnRow (int det, float col, float row, float FcsZ=-1.0) const
 get the STAR frame cooridnates from other way More...
 
StThreeVectorD getStarXYZ (int det, int col, int row, float FcsZ=-1.0) const
 get coordinates of center of the cell STAR frame from det/row/column
 
StThreeVectorD getStarXYZ (const StFcsHit *hit, float FcsZ=-1.0) const
 get coordinates of center of the cell STAR frame from StFcsHit
 
StThreeVectorD getStarXYZ (const StFcsCluster *clu, float FcsZ=-1.0) const
 get coordinates of the cluster STAR frame from StFcsCluster
 
StThreeVectorD getStarXYZ (int det, int id, float FcsZ=-1.0) const
 get coordinates of center of the cell in STAR frame from det/id
 
StThreeVectorD getStarXYZ_4x4 (int det, int col, int row) const
 Get the STAR frame cooridnates for 4x4 sum. More...
 
StLorentzVectorD getLorentzVector (const StThreeVectorD &xyz, float energy, float zVertex=0.0)
 Get get 4 vector assuing m=0 and taking beamline from DB.
 
double getHcalProjectedToEcalX (int ns, double hcalLocalX, double zvtx=0.0)
 Project Hcal local X to Ecal local X [cm]. More...
 
double getHcalProjectedToEcalY (int ns, double hcalLocalY, double zvtx=0.0)
 Project Hcal local Y to Ecal local Y [cm].
 
double getProjectedDistance (StFcsCluster *ecal, StFcsCluster *hcal, double zvtx=0.0)
 Project Hcal cluster to Ecal plane and get distance from Ecal cluster [cm].
 
double getProjectedDistance (StFcsPoint *ecal, StFcsCluster *hcal, double zvtx=0.0)
 Project Hcal cluster to Ecal plane and get distance from Ecal point [cm].
 
int getZeroSuppression (int det) const
 fcsGain/GainCorrection related
 
float getSamplingFraction (int det) const
 get zero suppression threshold
 
float getGain (int det, int id) const
 get sampling fraction
 
float getGain (StFcsHit *hit) const
 get the gain for the channel for 16 timebin sum
 
float getGain8 (int det, int id) const
 get the gain for the channel for 16 timebin sum
 
float getGain8 (StFcsHit *hit) const
 get the gain for the channel for 8 timebin sum
 
float getGainCorrection (int det, int id) const
 get the gain for the channel for 8 timebin sum
 
float getGainCorrection (StFcsHit *hit) const
 get the gain correction for the channel
 
float getPresValley (int det, int id) const
 get the gain correction for the channel
 
float getPresValley (StFcsHit *hit) const
 get the pres valley position for cut
 
float getGainOnline (int det, int id) const
 get the pres valley position for cut
 
float getGainOnline (StFcsHit *hit) const
 get the gain correction for the channel
 
float getPresThreshold (int det, int id) const
 get the gain correction for the channel
 
float getPresThreshold (StFcsHit *hit) const
 get the pres valley position for cut
 
void forceFixGain ()
 Gain mode switch.
 
void forceFixGainCorrection ()
 fixed default gain
 
void forceUniformGain (float ecal, float hcal=0.0053, float pres=0.01)
 fixed default gaincorr More...
 
void forceUniformGainCorrection (float ecal, float hcal=1.0, float pres=0.5)
 
void forceUniformGainOnline (float ecal, float hcal=1.0, float pres=0.5)
 
void setReadGainFromText (const char *file="fcsgain.txt")
 reading gain from text files
 
void setReadGainCorrFromText (const char *file="fcsgaincorr.txt")
 
float getEtGain (int det, int id, float factor=1.0) const
 
void printEtGain ()
 ET gain.
 
void getDepfromId (int detectorId, int id, int &ehp, int &ns, int &crt, int &slt, int &dep, int &ch) const
 print ET gain More...
 
void getIdfromDep (int ehp, int ns, int dep, int ch, int &detectorId, int &id, int &crt, int &slt) const
 Get DEP map.
 
int getNDep (int ehp, int ns) const
 Get Det map.
 
void getSCmap (int det, int id, int &ehp, int &ns, int &scdep, int &branch, int &fee_i2c, int &sipm, int &pp, int &jacket) const
 

of DEP


 
void getIdfromSCmap (int ehp, int ns, int scdep, int branch, int fee_i2c, int sipm, int &det, int &id) const
 Get SC map.
 
void makeMap ()
 Get Id from SC.
 
void makePPMap ()
 Generate maps (this is the origin of the map)
 
int jacketColor (int ehp, int ns, int dep, int ch)
 Generate Patchpanel map.
 
void makeMap2019 ()
 cable jacket color
 
void printMap ()
 Generate map for run19.
 
void printHeader (FILE *f, int flag, int csv)
 Print maps.
 
void printHeader2 (FILE *f)
 Map header.
 
void printHeader3 (FILE *f)
 Map header.
 
void printHeader4 (FILE *f, int flag)
 Map header.
 
void getIdfromEPD (int pp, int tt, int &det, int &id)
 Map header.
 
void getEPDfromId (int det, int id, int &pp, int &tt)
 Get FCS's EPD map foom EPD mapping.
 
float pedestal (int ehp, int ns, int dep, int ch)
 Get EPD's EPD map from FCS mapping. More...
 
void setPedestal (int ehp, int ns, int dep, int ch, float ped)
 get Pedestal
 
void readPedFromText (const char *file="fcsped.txt")
 setting pedestal
 
unsigned int backTraceG2tTrack (unsigned int id, g2t_track_st *g2ttrk)
 reading pedestal from text
 
const g2t_track_st * getParentG2tTrack (StFcsHit *h, g2t_track_st *g2ttrk, float &fraction, int &ntrk, unsigned int order=0)
 
const g2t_track_st * getParentG2tTrack (StFcsCluster *c, g2t_track_st *g2ttrk, float &fraction, int &ntrk, unsigned int order=0)
 
const g2t_track_st * getPrimaryG2tTrack (StFcsHit *h, g2t_track_st *g2ttrk, float &fraction, int &ntrk, unsigned int order=0)
 
const g2t_track_st * getPrimaryG2tTrack (StFcsCluster *c, g2t_track_st *g2ttrk, float &fraction, int &ntrk, unsigned int order=0)
 
StThreeVectorD projectTrackToEcal (const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
 project a g2t track to Ecal with a given track and vertex. If no vertex given assume a vertex of (0,0,0)
 
StThreeVectorD projectTrackToHcal (const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
 project a g2t track to Hcal with a given track and vertex. If no vertex given assume a vertex of (0,0,0)
 
StThreeVectorD projectTrackToEcalSMax (const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
 SMax = Shower Max Z.
 
StThreeVectorD projectTrackToHcalSMax (const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
 SMax = Shower Max Z.
 
StThreeVectorD projectTrack (int det, const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert, double showermaxz=-1) const
 Generic g2t track projection function but #det and #showermaxz needs to be specified; if #det or #showermaxz not known use corresponding projectTrackToEcal(), projectTrackToHcal(), projectTrackToEcalSMax, projectTrackToHcalSMax instead.
 
StThreeVectorD projectLine (int det, StThreeVectorD &linedirection, StThreeVectorD &lineorigin, double showermaxz=-1) const
 Like #projectLine(det, double*, double*, double) except use StThreeVectorD for line direction and origin.
 
StThreeVectorD projectLine (int det, double *linedirection, double *lineorigin, double showermaxz=-1) const
 XYZ of a projected line to the FCS detector plane. More...
 
- Public Member Functions inherited from TDataSet
 TDataSet (const char *name="", TDataSet *parent=0, Bool_t arrayFlag=kFALSE)
 
 TDataSet (const TDataSet &src, EDataSetPass iopt=kAll)
 
 TDataSet (TNode &src)
 This copy ctor has been depricated (left for thwe sake of the backweard compatibility)
 
virtual ~TDataSet ()
 std::cout << "Default destructor for " << GetName() << " - " << GetTitle() << std::endl;
 
virtual void Add (TDataSet *dataset)
 
virtual void AddAt (TDataSet *dataset, Int_t idx=0)
 
virtual void AddAtAndExpand (TDataSet *dataset, Int_t idx=0)
 
virtual void AddFirst (TDataSet *dataset)
 Add TDataSet object at the beginning of the dataset list of this dataset.
 
virtual void AddLast (TDataSet *dataset)
 Add TDataSet object at the end of the dataset list of this dataset.
 
TDataSetAt (Int_t idx) const
 
virtual void Browse (TBrowser *b)
 Browse this dataset (called by TBrowser).
 
virtual TObject * Clone (const char *newname="") const
 the custom implementation fo the TObject::Clone
 
virtual void Delete (Option_t *opt="")
 
virtual TDataSetFind (const char *path) const
 
virtual TDataSetFindByName (const char *name, const char *path="", Option_t *opt="") const
 
virtual TDataSetFindByPath (const char *path) const
 Aliase for TDataSet::Find(const Char_t *path) method.
 
virtual TDataSetFindByTitle (const char *title, const char *path="", Option_t *opt="") const
 
TObject * FindObject (const char *name) const
 
TObject * FindObject (const TObject *o) const
 
virtual TDataSetFirst () const
 Return the first object in the list. Returns 0 when list is empty.
 
TObjArray * GetObjArray () const
 
virtual TSeqCollection * GetCollection () const
 
TList * GetList () const
 
virtual Int_t GetListSize () const
 
TObject * GetMother () const
 
virtual TObject * GetObject () const
 The depricated method (left here for the sake of the backward compatibility)
 
virtual TDataSetGetParent () const
 
virtual Long_t HasData () const
 
virtual TDataSetInstance () const
 
virtual TString Path () const
 return the full path of this data set
 
virtual EDataSetPass Pass (EDataSetPass(*callback)(TDataSet *), Int_t depth=0)
 
virtual EDataSetPass Pass (EDataSetPass(*callback)(TDataSet *, void *), void *user, Int_t depth=0)
 
virtual void PrintContents (Option_t *opt="") const
 
virtual Int_t Purge (Option_t *opt="")
 
virtual void Remove (TDataSet *set)
 Remiove the "set" from this TDataSet.
 
virtual TDataSetRemoveAt (Int_t idx)
 
virtual void SetMother (TDataSet *parent=0)
 
virtual void SetObject (TObject *obj)
 The depricated method (left here for the sake of the backward compatibility)
 
virtual void SetParent (TDataSet *parent=0)
 
virtual void SetWrite ()
 
virtual void Shunt (TDataSet *newParent=0)
 
virtual void Sort ()
 Sort recursively all members of the TDataSet with TList::Sort method.
 
virtual Bool_t IsEmpty () const
 return kTRUE if the "internal" collection has no member
 
virtual Bool_t IsFolder () const
 
virtual Bool_t IsMarked () const
 
virtual Bool_t IsThisDir (const char *dirname, int len=-1, int ignorecase=0) const
 
virtual TDataSetLast () const
 Return the last object in the list. Returns 0 when list is empty.
 
virtual void ls (Option_t *option="") const
 
virtual void ls (Int_t depth) const
 
void Mark ()
 
void UnMark ()
 
void MarkAll ()
 Mark all members of this dataset.
 
void UnMarkAll ()
 UnMark all members of this dataset.
 
void InvertAllMarks ()
 Invert mark bit for all members of this dataset.
 
void Mark (UInt_t flag, EBitOpt reset=kSet)
 
virtual TDataSetNext () const
 
virtual TDataSetPrev () const
 
virtual void Update ()
 
virtual void Update (TDataSet *set, UInt_t opt=0)
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 

Static Public Member Functions

static void getFromName (const char name[], int &det, int &id)
 Get Name of a channel.
 
static int getDetFromName (const std::string &detname)
 Get det/id from name.
 
static unsigned short getKey (unsigned short detid, unsigned short id)
 Get det from name.
 
static void getDetIdFromKey (unsigned short key, unsigned short &detid, unsigned short &id)
 
static unsigned short getDetFromKey (unsigned short key)
 
static unsigned short getIdFromKey (unsigned short key)
 
- Static Public Member Functions inherited from TDataSet
static TDataSetGetMainSet ()
 return pointer to the main dataset
 
static TDataSetinstance ()
 

Additional Inherited Members

- Protected Member Functions inherited from TDataSet
virtual void SetMother (TObject *mother)
 
 TDataSet (const char *name, const char *title)
 
void AddMain (TDataSet *set)
 add data set to main data set
 
TDataSetGetRealParent ()
 return real parent
 
void MakeCollection ()
 Create the internal container at once if any.
 
- Static Protected Member Functions inherited from TDataSet
static EDataSetPass SortIt (TDataSet *ds)
 
static EDataSetPass SortIt (TDataSet *ds, void *user)
 
- Protected Attributes inherited from TDataSet
TDataSetfParent
 
TSeqCollection * fList
 
- Static Protected Attributes inherited from TDataSet
static TDataSetfgMainSet = &mainSet
 

Detailed Description

Definition at line 118 of file StFcsDb.h.

Member Function Documentation

void StFcsDb::forceUniformGain ( float  ecal,
float  hcal = 0.0053,
float  pres = 0.01 
)
inline

fixed default gaincorr

force a specified value

Definition at line 234 of file StFcsDb.h.

void StFcsDb::forceUniformGainCorrection ( float  ecal,
float  hcal = 1.0,
float  pres = 0.5 
)
inline

force a specified value

Definition at line 240 of file StFcsDb.h.

void StFcsDb::forceUniformGainOnline ( float  ecal,
float  hcal = 1.0,
float  pres = 0.5 
)
inline

force a specified value

Definition at line 246 of file StFcsDb.h.

void StFcsDb::getDepfromId ( int  detectorId,
int  id,
int &  ehp,
int &  ns,
int &  crt,
int &  slt,
int &  dep,
int &  ch 
) const

print ET gain

Fcs Map

Definition at line 1018 of file StFcsDb.cxx.

References detectorId().

Referenced by getGain(), getGainCorrection(), getGainOnline(), getName(), StFcsMIPMaker::Init(), and printMap().

StThreeVectorD StFcsDb::getDetectorOffset ( int  det,
double  zdepth = -1 
) const

Utility functions related to DetectorPosition.

get the offset of the detector.

Get the inside corner of a given detector in global STAR coordinates. The x coordinate refers to the inside edge (closer to beam pipe). The y coordinate refers to the y-center of the detector. z coordinate is the front face of the detector unless zdepth>0.

Parameters
detdetector id to get for offset
zdepthdepth in z of the detector to get point for. Negative values return z of front face

Definition at line 578 of file StFcsDb.cxx.

References getDetectorAngle(), getYWidth(), and nRow().

Referenced by getHcalProjectedToEcalX(), getHcalProjectedToEcalY(), getStarXYZ(), and projectLine().

double StFcsDb::getHcalProjectedToEcalX ( int  ns,
double  hcalLocalX,
double  zvtx = 0.0 
)

Project Hcal local X to Ecal local X [cm].

Project Hcal local x/y to Ecal local x/y [cm] See https://www.star.bnl.gov/protected/spin/akio/fcs/fcsProjection.pdf

Definition at line 695 of file StFcsDb.cxx.

References getDetectorOffset(), and getXWidth().

Referenced by getProjectedDistance(), and StFcsEcalHcalMipMaker::Make().

void StFcsDb::getLocalXYinCell ( StFcsHit hit,
float &  x,
float &  y 
) const

getting XY in local cell coordinate

Get xy of center of the cell in local cell coordinate.

Definition at line 652 of file StFcsDb.cxx.

Referenced by getStarXYZ().

const g2t_track_st * StFcsDb::getParentG2tTrack ( StFcsHit h,
g2t_track_st *  g2ttrk,
float &  fraction,
int &  ntrk,
unsigned int  order = 0 
)

Getting pointer to parent & primary g2t_track from StFcsHit & StFcsCluster User need to provide g2t_track_st table from geant.root file order=0 (default) gives the top contributing g2t_track for the hit/cluster. 1,2... for lower contributer It also returns fraction of dE from the g2t_track to the hit/cluster It also returns number of g2t_tracks contributing to the hit/cluster

Definition at line 2191 of file StFcsDb.cxx.

StThreeVectorD StFcsDb::getStarXYZ ( int  det,
float  FcsX,
float  FcsY,
float  FcsZ = -1.0,
float  zVertex = 0.0 
) const

get the STAR frame cooridnates from local XYZ [cm]

get coordinates in STAR frame from local XY (in row/column space [cm])

north side

Definition at line 868 of file StFcsDb.cxx.

References getDetectorAngle(), getDetectorOffset(), getYWidth(), northSouth(), and nRow().

Referenced by getEta(), getPhi(), getStarXYZ(), getStarXYZ_4x4(), getStarXYZfromColumnRow(), StFcsEventDisplay::Make(), and printEtGain().

StThreeVectorD StFcsDb::getStarXYZ_4x4 ( int  det,
int  col,
int  row 
) const

Get the STAR frame cooridnates for 4x4 sum.

get coordinates of center of 4x4 sums in STAR frame Ecal 4x4 : col goes 1-9 row goes 1-15 Hcal 4x4 : col goes 1-5 row goes 1-9

Definition at line 678 of file StFcsDb.cxx.

References getStarXYZ().

StThreeVectorD StFcsDb::getStarXYZfromColumnRow ( int  det,
float  col,
float  row,
float  FcsZ = -1.0 
) const

get the STAR frame cooridnates from other way

get coordinates in STAR frame from det/row/column grid space [unit is cell size in float]

Definition at line 863 of file StFcsDb.cxx.

References getStarXYZ(), getXWidth(), and getYWidth().

Referenced by getStarXYZ(), StFcsMIPMaker::Make(), StFcsTrackMatchMaker::Make(), StFcsPi0ReconstructionMaker::Make(), StFcsPi0FinderForEcal::Make(), and StFcsEventDisplay::Make().

int StFcsDb::maxDetectorId ( ) const

set fcsPresThreshold_st*

Utility functions related to FCS ChannelGeometry

Definition at line 416 of file StFcsDb.cxx.

float StFcsDb::pedestal ( int  ehp,
int  ns,
int  dep,
int  ch 
)

Get EPD's EPD map from FCS mapping.

Pedestal

Definition at line 2116 of file StFcsDb.cxx.

Referenced by StFcsQaMaker::Make().

StThreeVectorD StFcsDb::projectLine ( int  det,
double *  linedirection,
double *  lineorigin,
double  showermaxz = -1 
) const

XYZ of a projected line to the FCS detector plane.

Get the STAR XYZ that corresponds to the intersection of the FCS plane and a line given by the direction of some azimuthal angle and polar angle. You can also specify the origin of the line in the global STAR XYZ coordinates.

Note: if you choose the wrong detector for a given polar angle you will get the wrong projection so please use projectTrackToEcal(), projectTrackToHcal(), projectTrackToEcalSMax(), or projectTrackToHcalSMax() to take into account which polar angle goes to which detector.

Parameters
detdetector id to project line to (needed for correct angle).
linedirectionsize 3 array indicating the direction of the line to project onto #det, first element x-direction, second element y-direction, third element z-direction
lineoriginsize 3 array indication the origin of the line to project onto #det, first element is x-coordinate, second element is y-coordinate, third element is z-coordinate
zhowermaxdepth in z of the detector to project the line to. Any negative value will use #getShowerMaxZ()

Definition at line 817 of file StFcsDb.cxx.

References getDetectorAngle(), and getDetectorOffset().

void StFcsDb::setFcsDetectorPosition ( fcsDetectorPosition_st *  t)

set Et Gain Setting 0=Auto from run#, 1=Old, 2=New(23027048)

Setting DB table

Definition at line 255 of file StFcsDb.cxx.


The documentation for this class was generated from the following files: