20 bool gRotationIsOn =
false;
100 for (
int softId = 1; softId<=4800; ++softId) {
102 Color_t colorResponce=kWhite;
104 mBemcTables->
getStatus(1, softId, status);
105 if (status != 1)
continue;
108 if (adc < ped + 3 * rms)
continue;
110 mBemcTables->
getCalib(1, softId, 1, calib);
111 float energy = calib * (adc - ped);
114 cout <<
"id =" << softId <<
" energy =" << energy << endl;
115 cout <<
" adc = " << adc << endl;
116 cout <<
" status = " << status << endl;
117 cout <<
" ped = " << ped << endl;
118 cout <<
" rms = " << rms << endl;
119 cout <<
" calib = " << calib << endl;
121 if (energy > 0 && energy < 30) {
123 if ( energy < 0.3 ) { colorResponce = kBlue;
126 }
else if (energy < 1.0 ) colorResponce = kGreen;
129 else if ( energy < 4.0 && energy>1.0) colorResponce = kYellow;
131 else colorResponce = kRed;
133 const double maxSize = 400.;
134 const double scale = 10.;
135 float size =(scale)*energy;
136 if (size > maxSize) size = maxSize ;
137 if (!cuts || (cuts && energy>1.0)) {
138 gEd->
EmcHit(softId,colorResponce, 0, size);
139 gEd->AddComment(Form(
"energy = %f size=%f ",energy,size));
162 cout <<
"Adding tracks ----------------------------- " << endl;
163 cout <<
"Run / Event Number: " << muDstMaker->
muDst()->
event()->runNumber() <<
" / " << muDstMaker->
muDst()->
event()->eventNumber() << endl;
165 size_t n_prim=StMuDst::GetNPrimaryTrack();
168 for (
size_t i_track=0; i_track < n_prim; ++i_track) {
170 double pt =track.
pt();
171 short charge= track.
charge();
173 if (!cuts || (cuts && (pt>2 && nSigmaE>-0.5))) {
174 Style_t sty = gEd->
Style(kPrimaryTrack).Sty();
175 Size_t siz = gEd->
Style(kPrimaryTrack).Siz();
177 gEd->AddComment(Form(
"pT = %f charge=%d ",pt,charge));
181 cout << counter <<
" primary tracks have been rendered" << endl;
208 void mrd(
bool doTowerCuts=
false,
bool doTrackCuts=
false,
bool clear=
true)
212 if (clear) gEd->
Clear();
246 void mae(
bool rotation=
false,
bool doTowerCuts=
false,
bool doTrackCuts=
false,
int skipEvent = 205 )
253 chain->Skip(skipEvent);
259 cout <<
"Run / Event Number: " << muDstMaker->
muDst()->
event()->runNumber() <<
" / " << muDstMaker->
muDst()->
event()->eventNumber() << endl;
260 mrd(doTowerCuts,doTrackCuts);
264 if (rotation && !gRotationIsOn ) {
266 gRotationIsOn =
true;
269 printf(
" muEvent is empty\n");
292 "/star/institutions/bnl/fine/testfiles/st_upsilon_8112020_raw_1130030.MuDst.root"
293 ,
const char * detectorNames=
"TPC,StarBeam")
296 if ( gSystem->AccessPathName(file)) {
298 <<
"** Error ** : The input file: <"<< file <<
"> does not exist !!!"
300 <<
" Please select the existing one and re-call the function: "
302 << endl <<
" root [0] EdMu(\"new file ROOT file name\")"
304 << endl <<
"To draw the StEvent components with no detector geometry, use: "
306 << endl <<
" root [0] EdMu(\"new file ROOT file name\",0)"
311 TString muDstFile=file;
312 gROOT->Macro(
"loadMuDst.C");
313 gSystem->Load(
"St_Tables.so");
314 gSystem->Load(
"St_db_Maker.so");
315 gSystem->Load(
"StTpcDb");
316 gSystem->Load(
"StDetectorDbMaker");
317 gSystem->Load(
"StDbUtilities");
318 gSystem->Load(
"StDbLib");
319 gSystem->Load(
"StDbBroker");
321 gSystem->Load(
"StEEmcUtil");
331 printf(
"\n The display is ready!\n");
332 printf(
" calling:\n");
336 printf(
"method to read and show the next event\n");
340 printf(
"\tmae() - to advance the event \n");
341 printf(
"\tmrd() - to redraw the event\n");
void mae(bool rotation=false, bool doTowerCuts=false, bool doTrackCuts=false, int skipEvent=205)
This mae (AdvanceEvent) function is to search for the next non-empty event and draw it by looping ove...
Double_t pt() const
Returns pT at point of dca to primary vertex.
StBemcTables(Bool_t btowMapFix=kFALSE, Bool_t bprsMapFix=kFALSE)
StBemcTables constructor.
int status(int det, int softId, const char *option="") const
virtual const StDraw3DStyle & Style(EDraw3DStyle type) const
Return the reference to the predefined StDraw3DStyle object.
Class StuDraw3DMuEvent - to draw the StMuDst primitives like StMuTrack as 3D points and 3D lines deco...
virtual void SetBkColor(Color_t newBkColor)
Set the ROOT color as the widget background.
static Color_t Pt2Color(double pt)
Maps the track pt to the STAR StTrack track color code.
void getPedestal(Int_t det, Int_t softId, Int_t cap, Float_t &ped, Float_t &rms) const
Return pedestal mean and rms.
Short_t charge() const
Returns charge.
void loadTables(StMaker *anyMaker)
load tables.
void EdMu(const char *file="/star/institutions/bnl/fine/testfiles/st_upsilon_8112020_raw_1130030.MuDst.root", const char *detectorNames="TPC,StarBeam")
Main entry point to initialize the primitive "Event Display" and the STAR bfc chain.
virtual TObject * Track(const StMuTrack &track, Color_t col, Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
Add track to the display list with the col color, sty style, and siz size if provided.
void addEmcHits(bool cuts=false)
Add emc hits to the list of the rendered objects.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
void mrd(bool doTowerCuts=false, bool doTrackCuts=false, bool clear=true)
This mrd (RedrawEvent) function redraws all hits and/or tracks from the current event.
Double_t nSigmaElectron() const
Returns Craig's distance to the calculated dE/dx band for electrons in units of sigma.
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
void getCalib(Int_t det, Int_t softId, Int_t power, Float_t &calib) const
Return calibration constant.
void getStatus(Int_t det, Int_t softId, Int_t &status, const char *option="") const
Return status.
virtual void SetDrawOption(Option_t *option="")
Set the varous drawing option. The method passes the input options to TQtCoinWidget::SetDrawOption me...
virtual TObject * EmcHit(Int_t emcHitsSoftId, Color_t col, Style_t sty, Size_t siz, const char *detIdt="bemc")
Add EMC hit defined emcHitsSoftId to the display list with the col color sty and size if provided...
void addTracks(bool cuts=false)
Add tracks to the list of the rendered objects from current MuDst event.
virtual void Clear(Option_t *opt="update")
Remove all objects from the list and update the screen if opt is "update".
virtual void Endcaps(Style_t sty=0)
Add the endcap towers to the list to display.