MINFFLS Class Reference

#include <MINFFLS.h>

Inheritance diagram for MINFFLS:
MINFDetector

List of all members.

Public Member Functions

 MINFFLS ()
 MINFFLS (const char *name, const char *title="")
virtual ~MINFFLS ()
virtual void BookHits (REROOT_Event *revt)
Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual void DumpHit (Int_t ihit)
virtual Float_t GetHitELOSS (Int_t ihit)
virtual Float_t GetHitPartMom (Int_t ihit)
virtual Int_t GetIPDG (Int_t ihit)
virtual void InspectHit (Int_t ihit)
virtual void Paint (Option_t *opt="")

Detailed Description

Definition at line 19 of file MINFFLS.h.


Constructor & Destructor Documentation

MINFFLS::MINFFLS (  ) 

Definition at line 46 of file MINFFLS.cxx.

00047 {
00048    fNV       = 0;
00049    fNH       = 0;
00050    fIshunt   = 0;
00051 }

MINFFLS::MINFFLS ( const char *  name,
const char *  title = "" 
)

Definition at line 54 of file MINFFLS.cxx.

References MINFDetector::fHits, MINFDetector::fIshunt, MINFDetector::fNH, and MINFDetector::fNV.

00054                                                     :
00055    MINFDetector(name,title)
00056 {
00057 
00058 //Begin_Html
00059 /*
00060 <img src="gif/MINFfls.gif">
00061 */
00062 //End_Html
00063 
00064    fHits = new TClonesArray("MINFFLSHit", 405);
00065 
00066    fNV         =  1;
00067    fNH         =  3;
00068    fIshunt     =  0;
00069 }

MINFFLS::~MINFFLS (  )  [virtual]

Definition at line 72 of file MINFFLS.cxx.

00073 {
00074 }


Member Function Documentation

void MINFFLS::BookHits ( REROOT_Event revt  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 77 of file MINFFLS.cxx.

References REROOT_PlanePos::ActvSpec(), REROOT_FLSHit::CellPos(), REROOT_Geom::cellposs(), REROOT_Geom::curgeom(), det, MINFDetector::fHits, MINFDetector::fIshunt, MINFast::FLS, REROOT_Event::flshits(), MINFDetector::fNhits, MINFDetector::fTrkHits, MINFast::GetNtrack(), MINFDetector::GetTrkHits(), gMINFast, REROOT_FLSHit::IPln(), REROOT_FLSHit::ITrack(), REROOT_Event::n_flshits(), REROOT_Geom::planeposs(), REROOT_Geom::planespecs(), REROOT_Rotm::r11(), REROOT_Rotm::r12(), REROOT_Rotm::r13(), REROOT_Rotm::r21(), REROOT_Rotm::r22(), REROOT_Rotm::r23(), REROOT_Rotm::r31(), REROOT_Rotm::r32(), REROOT_Rotm::r33(), REROOT_PlanePos::RotmID(), REROOT_Geom::rotms(), REROOT_PlaneSpec::Thickness(), REROOT_FLSHit::XBegin(), REROOT_FLSHit::XEnd(), REROOT_PlanePos::XYActv(), REROOT_CellPos::XYZCenter(), REROOT_FLSHit::YBegin(), REROOT_FLSHit::YEnd(), REROOT_FLSHit::ZBegin(), REROOT_FLSHit::ZEnd(), and REROOT_PlanePos::ZFrntActv().

00078 {
00079    
00080 // Get pointer to current REROOT_Geom object.
00081    REROOT_Geom *rgeo = REROOT_Geom::curgeom();
00082 
00083 // Set detector type index from MINFast enum of detector types.
00084    Int_t det = (MINFast::DETTYPE) MINFast::FLS;
00085 
00086 // Set up fTrkHits = TObjArray by track of TObjArrays by hit.
00087    Int_t ntracks = gMINFast->GetNtrack();
00088    fTrkHits = new TObjArray(ntracks);
00089 
00090 //gmi printf("MINFFLS::BookHits: create fTrkHits for ntracks = %d\n",
00091 //gmi                                                          ntracks);
00092 //gmi printf("MINFFLS::BookHits: Tracks in fTrkHits = %d\n",
00093 //gmi                                       fTrkHits->GetEntriesFast());
00094 
00095    for (Int_t itrk=0; itrk<ntracks; itrk++) {
00096      fTrkHits->Add(new TObjArray(50));
00097 
00098 //gmi printf("MINFFLS::BookHits: addhitarray to fTrkHits for trk %d\n",
00099 //gmi                                                             itrk);
00100 //gmi printf("MINFFLS::BookHits: Tracks in fTrkHits = %d\n",
00101 //gmi                                       fTrkHits->GetEntriesFast());
00102    }
00103 
00104    TClonesArray &lhits = *fHits;
00105    const TClonesArray *flshits = revt->flshits();
00106    REROOT_FLSHit *flshit;
00107 
00108    for (Int_t ihit=0; ihit<revt->n_flshits(); ihit++) {
00109      flshit = (REROOT_FLSHit *) flshits->At(ihit);
00110      Int_t track = TMath::Abs(flshit->ITrack()); // Should flag neg trks
00111 
00112 //gmi printf("MINFFLS::BookHits: processing hit %d\n",ihit);
00113 //gmi printf("MINFFLS::BookHits: Hit comes from track %d\n",
00114 //gmi                                                 flshit->ITrack());
00115 
00116 // Kludge until flshits gets meaningful track number.
00117      if (track >= ntracks)
00118       printf("MINFFLS::BookHits: Track no. %d >= number of tracks %d\n",
00119                                                         track, ntracks);
00120      track = TMath::Min(track, ntracks-1); 
00121 
00122 //gmi printf("MINFFLS::BookHits: Track no. converted to %d\n",track);
00123 //gmi printf("MINFFLS::BookHits: Hits so far this track = %d\n",
00124 //gmi                 ((TObjArray *) fTrkHits->At(track))->GetLast()+1);
00125 //gmi printf("MINFFLS::BookHits: Hits so far this track = %d\n",
00126 //gmi                   ((TObjArray *) GetTrkHits(track))->GetLast()+1);
00127 
00128 // Calculate XYZGlobal first.
00129      const TClonesArray *cellposs   = rgeo->cellposs();
00130      const TClonesArray *planeposs  = rgeo->planeposs();
00131      const TClonesArray *planespecs = rgeo->planespecs();
00132      const TClonesArray *rotms      = rgeo->rotms();
00133 
00134 // These lines are here for debug.  gmi
00135      if (!cellposs)   {cout << "cellposs = 0" << endl;  return;}
00136      if (!planeposs)  {cout << "planeposs = 0" << endl;  return;}
00137      if (!planespecs) {cout << "planespecs = 0" << endl;  return;}
00138      if (!rotms)      {cout << "rotms = 0" << endl;  return;}
00139 
00140 // Get pointer to REROOT_PlanePos from its TClonesArray.
00141      REROOT_PlanePos *planepos =
00142                       (REROOT_PlanePos *) planeposs->At(flshit->IPln());
00143 
00144 // Get pointer to REROOT_PlaneSpec from its TClonesArray.
00145      REROOT_PlaneSpec *planespec =
00146               (REROOT_PlaneSpec *) planespecs->At(planepos->ActvSpec());
00147 
00148 // Get pointer to REROOT_Rotm from its TClonesArray.
00149      REROOT_Rotm *rotm = (REROOT_Rotm *) rotms->At(planepos->RotmID());
00150 
00151 // Get pointer to REROOT_CellPos from its TClonesArray.
00152      REROOT_CellPos *cellpos =
00153                      (REROOT_CellPos *) cellposs->At(flshit->CellPos());
00154 
00155 // Calculate XYZGlobal[3] vector for hit.
00156      Float_t xyz_center[3];
00157      xyz_center[0] = planepos->XYActv()[0];
00158      xyz_center[1] = planepos->XYActv()[1];
00159      xyz_center[2] = planepos->ZFrntActv() + 0.5*planespec->Thickness();
00160 
00161      Float_t xyz_inplane[3];
00162      xyz_inplane[0] = 0.5 * (flshit->XEnd()+flshit->XBegin()) +
00163                             (cellpos->XYZCenter()[0]);
00164      xyz_inplane[1] = 0.5 * (flshit->YEnd()+flshit->YBegin()) +
00165                             (cellpos->XYZCenter()[1]);
00166      xyz_inplane[2] = 0.5 * (flshit->ZEnd()+flshit->ZBegin()) +
00167                             (cellpos->XYZCenter()[2]);
00168 
00169      Float_t XYZGlobal[3];
00170      XYZGlobal[0] = xyz_inplane[0]*rotm->r11() +
00171                     xyz_inplane[1]*rotm->r21() +
00172                     xyz_inplane[2]*rotm->r31() + xyz_center[0];
00173      XYZGlobal[1] = xyz_inplane[0]*rotm->r12() +
00174                     xyz_inplane[1]*rotm->r22() +
00175                     xyz_inplane[2]*rotm->r32() + xyz_center[1];
00176      XYZGlobal[2] = xyz_inplane[0]*rotm->r13() +
00177                     xyz_inplane[1]*rotm->r23() +
00178                     xyz_inplane[2]*rotm->r33() + xyz_center[2];
00179 
00180      Int_t *vol = 0;
00181      new(lhits[ihit]) MINFFLSHit(fIshunt,det,ihit,track,vol,XYZGlobal);
00182      fNhits++;
00183 
00184 //gmi printf("MINFFLS::BookHits: addhitarray to lhits for hit %d\n",
00185 //gmi                                                             ihit);
00186 //gmi printf("MINFFLS::BookHits: hits in lhits = %d\n",
00187 //gmi                                           lhits.GetEntriesFast());
00188 //gmi printf("MINFFLS::BookHits: fNhits = %d\n",fNhits);
00189 
00190 // Put pointer to this MINFFLSHit object into fTrkHits[track][itrkhit].
00191      ((TObjArray *) GetTrkHits(track))->Add(lhits[fNhits-1]);
00192 
00193    }
00194 }

Int_t MINFFLS::DistancetoPrimitive ( Int_t  px,
Int_t  py 
) [virtual]

Reimplemented from MINFDetector.

Definition at line 197 of file MINFFLS.cxx.

00198 {
00199    return 9999;
00200 }

void MINFFLS::DumpHit ( Int_t  ihit  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 203 of file MINFFLS.cxx.

References REROOT_Event::flshits(), MINFast::GetREROOTEvent(), gMINFast, and REROOT_FLSHit::printEvent().

00204 {
00205 
00206 // Dump REROOT object for selected hit.
00207 printf("MINFFLS::DumpHit number %d\n", ihit);
00208    const TClonesArray *flshits = gMINFast->GetREROOTEvent()->flshits();
00209    REROOT_FLSHit *flshit = (REROOT_FLSHit *) flshits->UncheckedAt(ihit);
00210    if (flshit) {
00211      flshit->printEvent(cout);
00212      flshit->Dump();
00213    }
00214 }

Float_t MINFFLS::GetHitELOSS ( Int_t  ihit  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 217 of file MINFFLS.cxx.

References REROOT_FLSHit::ELoss(), REROOT_Event::flshits(), MINFast::GetREROOTEvent(), and gMINFast.

00218 {
00219 
00220 // Returns ELOSS for selected hit.
00221    const TClonesArray *flshits = gMINFast->GetREROOTEvent()->flshits();
00222    REROOT_FLSHit *flshit = (REROOT_FLSHit *) flshits->UncheckedAt(ihit);
00223    if (!flshit) return 0.;
00224    return (flshit->ELoss());
00225 }

Float_t MINFFLS::GetHitPartMom ( Int_t  ihit  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 228 of file MINFFLS.cxx.

References REROOT_Event::flshits(), MINFast::GetREROOTEvent(), gMINFast, and REROOT_FLSHit::Ptot().

00229 {
00230 
00231 // Returns momentum of particle causing selected hit.
00232    const TClonesArray *flshits = gMINFast->GetREROOTEvent()->flshits();
00233    REROOT_FLSHit *flshit = (REROOT_FLSHit *) flshits->UncheckedAt(ihit);
00234    if (!flshit) return 0.;
00235    return (flshit->Ptot());
00236 }

Int_t MINFFLS::GetIPDG ( Int_t  ihit  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 239 of file MINFFLS.cxx.

References REROOT_Event::flshits(), MINFast::GetREROOTEvent(), gMINFast, and REROOT_FLSHit::IPDG().

00240 {
00241 
00242 // Get REROOT object for selected hit.
00243    const TClonesArray *flshits = gMINFast->GetREROOTEvent()->flshits();
00244    REROOT_FLSHit *flshit = (REROOT_FLSHit *) flshits->UncheckedAt(ihit);
00245    if (flshit) return (flshit->IPDG());
00246    return 0;
00247 }

void MINFFLS::InspectHit ( Int_t  ihit  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 250 of file MINFFLS.cxx.

References REROOT_Event::flshits(), MINFast::GetREROOTEvent(), and gMINFast.

00251 {
00252 
00253 // Inspect REROOT object for selected hit.
00254    const TClonesArray *flshits = gMINFast->GetREROOTEvent()->flshits();
00255    REROOT_FLSHit *flshit = (REROOT_FLSHit *) flshits->UncheckedAt(ihit);
00256    if (flshit) flshit->Inspect();
00257 }

void MINFFLS::Paint ( Option_t *  opt = ""  )  [virtual]

Reimplemented from MINFDetector.

Definition at line 260 of file MINFFLS.cxx.

00261 {
00262 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1