Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TMDC Class Reference

#include <TMDC.h>

Inheritance diagram for TMDC:

TUpdater TUpdater List of all members.

Public Member Functions

const AList< TMDCWireHit > & axialHits (unsigned mask=0) const
 returns a list of axial hits. 'update()' must be called before calling this function.
const AList< TMDCWireHit > & axialHits (unsigned mask=0) const
 returns a list of axial hits. 'update()' must be called before calling this function.
const AList< TMDCWireHit > & badHits (void)
 returns bad hits(finding invalid hits).
const AList< TMDCWireHit > & badHits (void)
 returns bad hits(finding invalid hits).
std::string cdcVersion (void) const
 returns MDC version.
std::string cdcVersion (void) const
 returns MDC version.
void classification (void)
 classify hits.
void classification (void)
 classify hits.
void clear (void)
 clears all TMDC information.
void clear (void)
 clears all TMDC information.
int debugLevel (int)
 sets debug level.
int debugLevel (void) const
 returns debug level.
int debugLevel (int)
 sets debug level.
int debugLevel (void) const
 returns debug level.
void dump (const std::string &message) const
 dumps debug information.
void dump (const std::string &message) const
 dumps debug information.
void fastClear (void)
 clears TMDC information.
void fastClear (void)
 clears TMDC information.
float fudgeFactor (float)
 sets/returns fudge factor for drift time error.
float fudgeFactor (void) const
 returns fudge factor for drift time error.
float fudgeFactor (float)
 sets/returns fudge factor for drift time error.
float fudgeFactor (void) const
 returns fudge factor for drift time error.
const AList< TMDCWireHit > & hits (unsigned mask=0) const
 returns a list of TMDCWireHit. 'update()' must be called before calling this function.
const AList< TMDCWireHit > & hits (unsigned mask=0) const
 returns a list of TMDCWireHit. 'update()' must be called before calling this function.
const AList< TMDCWireHitMC > & hitsMC (void) const
 returns a list of TMDCWireHitMC. 'updateMC()' must be called before calling this function.
const AList< TMDCWireHitMC > & hitsMC (void) const
 returns a list of TMDCWireHitMC. 'updateMC()' must be called before calling this function.
const TMDCLayer *const layer (unsigned id) const
 returns a pointer to a layer. 0 will be returned if 'id' is invalid.
const TMDCLayer *const layer (unsigned id) const
 returns a pointer to a layer. 0 will be returned if 'id' is invalid.
std::string name (void) const
 returns name.
std::string name (void) const
 returns name.
unsigned nLayers (void) const
unsigned nLayers (void) const
unsigned nLocalLayer (unsigned superLayerId) const
 returns # of wire layers in a super layer. 0 will be returned if 'superLayerId' is invalid.
unsigned nLocalLayer (unsigned superLayerId) const
 returns # of wire layers in a super layer. 0 will be returned if 'superLayerId' is invalid.
unsigned nSuperLayers (void) const
unsigned nSuperLayers (void) const
unsigned nWires (void) const
unsigned nWires (void) const
const AList< TMDCWireHit > & stereoHits (unsigned mask=0) const
 returns a list of stereo hits. 'update()' must be called before calling this function.
const AList< TMDCWireHit > & stereoHits (unsigned mask=0) const
 returns a list of stereo hits. 'update()' must be called before calling this function.
const AList< TMDCLayer
> *const 
superLayer (unsigned id) const
 returns a pointer to a super-layer. 0 will be returned if 'id' is invalid.
const AList< TMDCLayer
> *const 
superLayer (unsigned id) const
 returns a pointer to a super-layer. 0 will be returned if 'id' is invalid.
void update (bool mcAnalysis=true)
 updates TMDC information. clear() is called in this function.
void update (bool mcAnalysis=true)
 updates TMDC information. clear() is called in this function.
void updateMC (void)
 updates TMDC information for MC.
void updateMC (void)
 updates TMDC information for MC.
std::string version (void) const
 returns version.
std::string version (void) const
 returns version.
const TMDCWire *const wire (float r, float phi) const
 returns a pointer to a wire.
const TMDCWire *const wire (const HepPoint3D &point) const
 returns a pointer to a wire.
const TMDCWire *const wire (unsigned layerId, int localId) const
 returns a pointer to a wire. 'localId' can be negative. 0 will be returned if 'layerId' is invalid.
const TMDCWire *const wire (unsigned wireId) const
 returns a pointer to a wire. 0 will be returned if 'wireId' is invalid.
const TMDCWire *const wire (float r, float phi) const
 returns a pointer to a wire.
const TMDCWire *const wire (const HepPoint3D &point) const
 returns a pointer to a wire.
const TMDCWire *const wire (unsigned layerId, int localId) const
 returns a pointer to a wire. 'localId' can be negative. 0 will be returned if 'layerId' is invalid.
const TMDCWire *const wire (unsigned wireId) const
 returns a pointer to a wire. 0 will be returned if 'wireId' is invalid.

Static Public Member Functions

unsigned axialStereoLayerId (const MdcGeoLayer *const)
unsigned axialStereoLayerId (const MdcGeoLayer *const)
void driftDistance (TMLink &link, const TTrack &track, unsigned correctionFlag=0, float T0Offset=0.)
 calculates corrected drift time. correctionFlag(bit 0:tof, 1:T0 offset, 2:propagation delay, 3:tan(lambda) correction)
void driftDistance (TMLink &link, const TTrack &track, unsigned correctionFlag=0, float T0Offset=0.)
 calculates corrected drift time. correctionFlag(bit 0:tof, 1:T0 offset, 2:propagation delay, 3:tan(lambda) correction)
TMDCgetTMDC (void)
TMDCgetTMDC (const std::string &cdcVersion)
 returns TMDC object.
TMDCgetTMDC (void)
TMDCgetTMDC (const std::string &cdcVersion)
 returns TMDC object.
unsigned layerId (unsigned axialStereo, unsigned axialStereoLayerId)
unsigned layerId (const MdcGeoWire *const)
unsigned layerId (unsigned wireId)
unsigned layerId (unsigned axialStereo, unsigned axialStereoLayerId)
unsigned layerId (const MdcGeoWire *const)
unsigned layerId (unsigned wireId)
unsigned localId (const MdcGeoWire *const)
unsigned localId (unsigned wireId)
unsigned localId (const MdcGeoWire *const)
unsigned localId (unsigned wireId)
unsigned localLayerId (const MdcGeoLayer *const)
unsigned localLayerId (const MdcGeoWire *const)
unsigned localLayerId (unsigned wireId)
unsigned localLayerId (const MdcGeoLayer *const)
unsigned localLayerId (const MdcGeoWire *const)
unsigned localLayerId (unsigned wireId)
float phi (float phi)
float phi (float phi)
unsigned superLayerId (const MdcGeoLayer *const)
unsigned superLayerId (const MdcGeoWire *const)
unsigned superLayerId (unsigned wireId)
unsigned superLayerId (const MdcGeoLayer *const)
unsigned superLayerId (const MdcGeoWire *const)
unsigned superLayerId (unsigned wireId)
std::string wireName (const MdcRec_wirhit &)
std::string wireName (const MdcGeoWire *const)
std::string wireName (unsigned wireId)
std::string wireName (const MdcRec_wirhit &)
std::string wireName (const MdcGeoWire *const)
std::string wireName (unsigned wireId)

Private Member Functions

void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
virtual void initialize (void)
 initializes an object.
virtual void initialize (void)
 initializes an object.
virtual bool initialized (void) const
 returns true if an object is initialized.
virtual bool initialized (void) const
 returns true if an object is initialized.
 TMDC (const std::string &cdcVersion)
 Constructor.
 TMDC (const std::string &cdcVersion)
 Constructor.
virtual void update (void)
 updates an object.
virtual bool updated (void) const
 returns true if an object is updated.
virtual bool updated (void) const
 returns true if an object is updated.

Private Attributes

AList< TMDCWireHit_axialHits
AList< TMDCWireHit_axialHits
AList< TMDCWireHit_badHits
AList< TMDCWireHit_badHits
const std::string _cdcVersion
int _debugLevel
float _fudgeFactor
AList< TMDCWireHit_hits
AList< TMDCWireHit_hits
AList< TMDCWireHitMC_hitsMC
AList< TMDCWireHitMC_hitsMC
AList< TMDCWire_hitWires
AList< TMDCWire_hitWires
AList< TMDCLayer_layers
AList< TMDCLayer_layers
const bool _newCdc
const unsigned _nLayers
const unsigned _nSuperLayers
const unsigned _nWires
AList< TMDCWireHit_stereoHits
AList< TMDCWireHit_stereoHits
AList< AList< TMDCLayer > > _superLayers
AList< AList< TMDCLayer > > _superLayers
AList< TMDCWire_wires
AList< TMDCWire_wires

Static Private Attributes

TMDC_cdc
TMDC_cdc = 0

Detailed Description

A class to represent MDC.

The instance of TMDC is a singleton. 'TMDC::getTMDC()' gives you a pointer to access the TMDC. Geometrical information is initialized automatically. Before accessing hit information, user has to call 'update()' to initialize hit information event by event.


Constructor & Destructor Documentation

TMDC::TMDC const std::string &  cdcVersion  )  [private]
 

Constructor.

00101 : _debugLevel(0),
00102   _fudgeFactor(1.),
00103   _cdcVersion(version), 
00104 //  _cdcVersion(-2000),
00105 //  _nWires(BsCouTab(GEOMDC_WIRE)),
00106 //  _nSuperLayers(BsCouTab(GEOMDC_SUPER)),
00107 //  _nLayers(BsCouTab(GEOMDC_LAYER)),
00108 //  _geo(MdcRecGeo::getMdcRecGeo()),
00109 //  _nWires(_geo->getWireSize()),
00110 //  _nSuperLayers(_geo->getSuperLayerSize()),
00111 //  _nLayers(_geo->getLayerSize()),
00112   _nWires(6796),
00113   _nSuperLayers(11),
00114   _nLayers(43),
00115   _newCdc(version == "-2000") {
00116     
00117     GMDC = this;
00118 
00119     //...Get MDC information...
00120     std::cout << "TMDC ... MDC version = " << _cdcVersion << std::endl;
00121 
00122     //...Check GEOMDC_WIRE...
00123 /*    if (BsCouTab(GEOMDC_LAYER) == 0) {
00124         std::cout << "TMDC !!! Bank GEOMDC_LAYER not found" << std::endl;
00125         std::cout << "     !!! mission impossible" << std::endl;
00126         std::cout << "     !!! TrkReco will crash!" << std::endl;
00127         std::cout << "     !!! Please stop execution" << std::endl;
00128         return;
00129     }
00130 */
00131 
00132   IMdcGeomSvc* mdcGeomSvc;
00133   StatusCode sc = Gaudi::svcLocator()->service("MdcGeomSvc", mdcGeomSvc);
00134   if (sc ==  StatusCode::SUCCESS) {
00135 //   mdcGeomSvc->Dump();
00136     
00137 //   _nWires = mdcGeomSvc->getWireSize();
00138 //   _nSuperLayers = mdcGeomSvc->getSuperLayerSize();
00139 //   _nLayers = mdcGeomSvc->getLayerSize();
00140    
00141     //...Create super-layers...
00142     for (unsigned i = 0; i < _nSuperLayers; i++)
00143         _superLayers.append(new AList<TMDCLayer>);
00144 
00145     //...Loop over all wires layers...
00146     unsigned nWires = 0;
00147     for (unsigned i = 0; i < _nLayers; i++) {
00148 //      struct geocdc_layer * l =
00149 //          (struct geocdc_layer *)
00150 //          BsGetEnt(GEOMDC_LAYER, i + 1, BBS_No_Index);
00151             
00152         const MdcGeoLayer * l = mdcGeomSvc->Layer(i);
00153         TMDCLayer * layer =  new TMDCLayer(l);
00154         _layers.append(layer);
00155         _superLayers[layer->superLayerId()]->append(layer);
00156 
00157         //...Loop over all wires in a layer...
00158         for (unsigned j = 0; j < l->NCell(); j++) {
00159 //      for (unsigned j = 0; j < l->m_div; j++) {
00160 //          struct geocdc_wire * w =
00161 //              (struct geocdc_wire *)
00162 //              BsGetEnt(GEOMDC_WIRE, nWires + 1, BBS_No_Index);
00163             const MdcGeoWire * w = mdcGeomSvc->Wire(l->Wirst()+j);
00164             TMDCWire * tw = new TMDCWire(w, layer);
00165             _wires.append(tw);
00166             layer->append(tw);
00167 
00168             ++nWires;
00169         }
00170     }
00171 
00172   } else {
00173 //    return StatusCode::FAILURE;
00174     return;
00175   }
00176  
00177 //  return StatusCode::SUCCESS;
00178 }

TMDC::TMDC const std::string &  cdcVersion  )  [private]
 

Constructor.


Member Function Documentation

const AList<TMDCWireHit>& TMDC::axialHits unsigned  mask = 0  )  const
 

returns a list of axial hits. 'update()' must be called before calling this function.

const AList< TMDCWireHit > & TMDC::axialHits unsigned  mask = 0  )  const
 

returns a list of axial hits. 'update()' must be called before calling this function.

00518                                    {
00519     if (! mask) return _axialHits;
00520     else if (mask == WireHitFindingValid) return _axialHits;
00521     std::cout << "TMDC::axialHits !!! unsupported mask given" << std::endl;
00522     return _axialHits;
00523 }

unsigned TMDC::axialStereoLayerId const MdcGeoLayer const  )  [static]
 

unsigned TMDC::axialStereoLayerId const MdcGeoLayer const  )  [static]
 

00991                                                     {
00992     if (! l) return 9999;
00993     unsigned id = l->Id();
00994 
00995     if (id < 8) return id;
00996     else if (id < 20) return id-8;
00997     else if (id < 36) return id-12;
00998     else if (id < 43) return id-24;
00999 
01000     return 9999;    
01001 }

const AList<TMDCWireHit>& TMDC::badHits void   ) 
 

returns bad hits(finding invalid hits).

const AList< TMDCWireHit > & TMDC::badHits void   ) 
 

returns bad hits(finding invalid hits).

00542                   {
00543     if (! updated()) update();
00544     if (_badHits.length()) return _badHits;
00545 
00546     //...Loop over RECMDC_WIRHIT bank...
00547 //    unsigned nReccdc = BsCouTab(RECMDC_WIRHIT);
00548     unsigned nReccdc = MdcRecWirhitCol::getMdcRecWirhitCol()->size();
00549     for (unsigned i = 0; i < nReccdc; i++) {
00550 //      struct reccdc_wirhit * h =
00551 //          (struct reccdc_wirhit *)
00552 //          BsGetEnt(RECMDC_WIRHIT, i + 1, BBS_No_Index);
00553         MdcRec_wirhit* h = &(*MdcRecWirhitCol::getMdcRecWirhitCol())[i];
00554         
00555         //...Check validity...
00556         if (h->stat & WireHitFindingValid) continue;
00557 
00558         //...Obtain a pointer to GEOMDC...
00559 //      geocdc_wire * g =
00560 //          (geocdc_wire *) BsGetEnt(GEOMDC_WIRE, h->m_geo, BBS_No_Index);
00561         const MdcGeoWire* g = h->geo;
00562         
00563         //...Get a pointer to a TMDCWire...
00564 //      TMDCWire * w = _wires[g->m_ID - 1];
00565         TMDCWire * w = _wires[g->Id()];
00566         
00567         //...Create TMDCWireHit...
00568         _badHits.append(new TMDCWireHit(w, h, _fudgeFactor));
00569     }
00570 
00571     return _badHits;
00572 }

std::string TMDC::cdcVersion void   )  const
 

returns MDC version.

std::string TMDC::cdcVersion void   )  const [inline]
 

returns MDC version.

00304                            {
00305     return std::string(_cdcVersion);
00306 }

void TMDC::classification void   ) 
 

classify hits.

void TMDC::classification void   ) 
 

classify hits.

00445                          {
00446     unsigned n = _hits.length();
00447 
00448     for (unsigned i = 0; i < n; i++) {
00449         TMDCWireHit * h = _hits[i];
00450         const TMDCWire * w = h->wire();
00451         unsigned state = h->state();
00452 
00453         //...Cache pointers to a neighbor...
00454         const TMDCWire * neighbor[6];
00455         for (unsigned j = 0; j < 6; j++) neighbor[j] = w->neighbor(j);
00456 
00457         //output to test ...
00458 //      cout<<w->localId()<<endl;
00459 //      if(neighbor[0]) cout<<"inner local:"<<neighbor[0]->localId()<<", "<<neighbor[1]->localId()<<endl;
00460 //      if(neighbor[5]) cout<<"outer local:"<<neighbor[4]->localId()<<", "<<neighbor[5]->localId()<<endl;   
00461                 
00462         //...Decide hit pattern...
00463         unsigned pattern = 0;
00464         for (unsigned j = 0; j < 6; j++) {
00465             if (neighbor[j])
00466                 if (neighbor[j]->hit())
00467                     pattern += (1 << j);
00468         }
00469         state |= (pattern << WireHitNeighborHit);
00470 
00471         //...Check isolation...
00472         const TMDCWireHit * hr1 = neighbor[2]->hit();
00473         const TMDCWireHit * hl1 = neighbor[3]->hit();
00474         if ((hr1 == 0) && (hl1 == 0)) {
00475             state |= WireHitIsolated;
00476         }
00477         else {
00478             const TMDCWireHit * hr2 = neighbor[2]->neighbor(2)->hit();
00479             const TMDCWireHit * hl2 = neighbor[3]->neighbor(3)->hit();
00480             if ((hr2 == 0) && (hr1 != 0) && (hl1 == 0) ||
00481                 (hl2 == 0) && (hl1 != 0) && (hr1 == 0))
00482                 state |= WireHitIsolated;
00483         }
00484 
00485         //...Check continuation...
00486         unsigned superLayer = w->superLayerId();
00487         bool previous = false;
00488         bool next = false;
00489         if (neighbor[0] == 0) previous = true;
00490         else {
00491             if ((neighbor[0]->hit()) || neighbor[1]->hit())
00492                 previous = true;
00493         }
00494         if (neighbor[5] == 0) next = true;
00495         else {
00496             if ((neighbor[4]->hit()) || neighbor[5]->hit())
00497                 next = true;
00498         }
00499         // if (previous && next) state |= WireHitContinuous;
00500         if (previous || next) state |= WireHitContinuous;
00501 
00502         //...Solve LR locally...
00503         if ((pattern == 34) || (pattern == 42) ||
00504             (pattern == 40) || (pattern == 10) ||
00505             (pattern == 35) || (pattern == 50))
00506             state |= WireHitPatternRight;
00507         else if ((pattern == 17) || (pattern == 21) ||
00508                  (pattern == 20) || (pattern ==  5) ||
00509                  (pattern == 19) || (pattern == 49))
00510             state |= WireHitPatternLeft;
00511 
00512         //...Store it...
00513         h->state(state);
00514     }
00515 }

void TMDC::clear void   )  [virtual]
 

clears all TMDC information.

Reimplemented from TUpdater.

void TMDC::clear void   )  [virtual]
 

clears all TMDC information.

Reimplemented from TUpdater.

00282                 {
00283     unsigned i = 0;
00284     while (TMDCWire * w = _wires[i++])
00285         w->clear();
00286 
00287     _hitWires.removeAll();
00288     _axialHits.removeAll();
00289     _stereoHits.removeAll();
00290     HepAListDeleteAll(_hits);
00291     HepAListDeleteAll(_hitsMC);
00292     HepAListDeleteAll(_badHits);
00293 
00294     TUpdater::clear();
00295 }

int TMDC::debugLevel int   ) 
 

sets debug level.

int TMDC::debugLevel void   )  const
 

returns debug level.

int TMDC::debugLevel int   )  [inline]
 

sets debug level.

00245                       {
00246     return _debugLevel = a;
00247 }

int TMDC::debugLevel void   )  const [inline]
 

returns debug level.

00239                            {
00240     return _debugLevel;
00241 }

void TMDC::driftDistance TMLink link,
const TTrack track,
unsigned  correctionFlag = 0,
float  T0Offset = 0.
[static]
 

calculates corrected drift time. correctionFlag(bit 0:tof, 1:T0 offset, 2:propagation delay, 3:tan(lambda) correction)

void TMDC::driftDistance TMLink link,
const TTrack track,
unsigned  correctionFlag = 0,
float  T0Offset = 0.
[static]
 

calculates corrected drift time. correctionFlag(bit 0:tof, 1:T0 offset, 2:propagation delay, 3:tan(lambda) correction)

01032                                     {
01033 
01034     //...No correction...
01035     if (flag == 0) {
01036         if (l.hit()) {
01037             l.drift(0, l.hit()->drift(0));
01038             l.drift(1, l.hit()->drift(1));
01039             l.dDrift(0, l.hit()->dDrift(0));
01040             l.dDrift(1, l.hit()->dDrift(1));
01041         }
01042         else {
01043             l.drift(0, 0.);
01044             l.drift(1, 0.);
01045             l.dDrift(0, 0.);
01046             l.dDrift(1, 0.);
01047         }
01048 
01049         return;
01050     }
01051 
01052     //...TOF correction...
01053     float tof = 0.;
01054     if (flag && 1) {
01055         int imass = 3;
01056         float tl = t.helix().a()[4];
01057         float f = sqrt(1. + tl * tl);
01058         float s = fabs(t.helix().curv()) * fabs(l.dPhi()) * f;
01059         float p = f / fabs(t.helix().a()[2]);
01060 //zsl   calcdc_tof2_(& imass, & p, & s, & tof); 
01061     }
01062 
01063     //...T0 correction....
01064     if (! (flag && 2)) t0Offset = 0.;
01065 
01066     //...Propagation corrections...
01067     const TMDCWireHit & h = * l.hit();
01068     int wire = h.wire()->id();
01069     HepVector3D tp = t.helix().momentum(l.dPhi());
01070     float p[3] = {tp.x(), tp.y(), tp.z()};
01071     const HepPoint3D & onWire = l.positionOnWire();
01072     float x[3] = {onWire.x(), onWire.y(), onWire.z()};
01073     float time = h.reccdc()->tdc + t0Offset - tof;
01074     float dist;
01075     float edist;
01076     int prop = (flag & 4);
01077 
01078     //...Calculation with left side...
01079     int side = -1;
01080     if (side == 0) side = -1;
01081 //zsl    calcdc_driftdist_(& prop,
01082 //                    & wire,
01083 //                    & side,
01084 //                    p,
01085 //                    x,
01086 //                    & time,
01087 //                    & dist,
01088 //                    & edist);
01089     l.drift(0, dist);
01090     l.dDrift(0, edist);
01091 
01092     //...Calculation with left side...
01093     side = 1;
01094 //zsl    calcdc_driftdist_(& prop,
01095 //                    & wire,
01096 //                    & side,
01097 //                    p,
01098 //                    x,
01099 //                    & time,
01100 //                    & dist,
01101 //                    & edist);
01102     l.drift(1, dist);
01103     l.dDrift(1, edist);
01104 
01105     //...tan(lambda) correction...
01106     if (flag && 8) {
01107         float tanl = abs(p[2]) / tp.perp();
01108         float c;
01109         if ((tanl >= 0.0) && (tanl < 0.5))      c = -0.48 * tanl + 1.3;
01110         else if ((tanl >= 0.5) && (tanl < 1.0)) c = -0.28 * tanl + 1.2;
01111         else if ((tanl >= 1.0) && (tanl < 1.5)) c = -0.16 * tanl + 1.08;
01112         else                                    c =  0.84;
01113 
01114         l.dDrift(0, l.dDrift(0) * c);
01115         l.dDrift(1, l.dDrift(1) * c);
01116     }
01117 }

void TUpdater::dump const std::string &  message = std::string(""),
const std::string &  prefix = std::string("")
const [inherited]
 

dumps debug information.

Reimplemented in TTrackManager, and TTrackManager.

00026                                                                  {
00027     std::cout << pre;
00028 
00029     std::cout << "updated:" << updated();
00030     std::cout << ",exp=" << _expN;
00031     std::cout << ",run=" << _runN;
00032     std::cout << ",evt=" << _evtN;
00033     std::cout << std::endl;
00034 }

void TMDC::dump const std::string &  message  )  const
 

dumps debug information.

void TMDC::dump const std::string &  message  )  const
 

dumps debug information.

00181                                       {
00182 //      if (   msg.index("name")    != -1
00183 //      || msg.index("version") != -1
00184 //      || msg.index("detail")  != -1
00185 //      || msg == "") {
00186   if (   msg.find("name")    != std::string::npos
00187         || msg.find("version") != std::string::npos
00188         || msg.find("detail")  != std::string::npos
00189         || msg == "") {
00190         std::cout << name() << "(" << version() << ") ";
00191     }
00192     if (msg.find("detail") != std::string::npos || msg.find("state") != std::string::npos) {
00193         std::cout << "Debug Level=" << _debugLevel;
00194     }
00195     std::cout << std::endl;
00196 
00197     std::string tab("        ");
00198 
00199     if (msg == "" || msg.find("geometry") != std::string::npos) {
00200 
00201         //...Get information..."
00202         unsigned nLayer = _layers.length();
00203         std::cout << "    version    : " << version() << std::endl;
00204         std::cout << "    cdc version: " << cdcVersion() << std::endl;
00205         std::cout << "    # of wires : " << _wires.length() << std::endl;
00206         std::cout << "    # of layers: " << nLayer << std::endl;
00207         std::cout << "    super layer information" << std::endl;
00208         std::cout << "        # of super layers = " << _superLayers.length()
00209                   << std::endl;
00210 
00211         std::cout << "    layer information" << std::endl;
00212         for (unsigned i = 0; i < _nLayers; i++)
00213             _layers[i]->dump("", tab);
00214 
00215         std::cout << "    wire information" << std::endl;
00216         for (unsigned i = 0; i < _nWires; i++)
00217             (_wires[i])->dump("neighbor", tab);
00218 
00219         return;
00220     }
00221     if (msg.find("hits") != std::string::npos) {
00222         std::cout << "    hits     : " << _hits.length() << std::endl;
00223         for (unsigned i = 0; i < _hits.length(); i++) {
00224             _hits[i]->dump("state mc", tab);
00225         }
00226     }
00227     if (msg.find("axialHits") != std::string::npos) {
00228         std::cout << "    hits     : " << _axialHits.length() << std::endl;
00229         for (unsigned i = 0; i < _axialHits.length(); i++) {
00230             _axialHits[i]->dump("state mc", tab);
00231         }
00232     }
00233     if (msg.find("stereoHits") != std::string::npos) {
00234         std::cout << "    hits     : " << _stereoHits.length() << std::endl;
00235         for (unsigned i = 0; i < _stereoHits.length(); i++) {
00236             _stereoHits[i]->dump("state mc", tab);
00237         }
00238     }
00239 }

void TMDC::fastClear void   ) 
 

clears TMDC information.

void TMDC::fastClear void   ) 
 

clears TMDC information.

00298                     {
00299     unsigned i = 0;
00300     while (TMDCWire * w = _hitWires[i++])
00301         w->clear();
00302     i = 0;
00303     while (TMDCWireHit * h = _badHits[i++])
00304         ((TMDCWire *) h->wire())->clear();
00305 
00306     _hitWires.removeAll();
00307     _axialHits.removeAll();
00308     _stereoHits.removeAll();
00309     HepAListDeleteAll(_hits);
00310     HepAListDeleteAll(_hitsMC);
00311     HepAListDeleteAll(_badHits);
00312 
00313     TUpdater::clear();
00314 }

float TMDC::fudgeFactor float   ) 
 

sets/returns fudge factor for drift time error.

float TMDC::fudgeFactor void   )  const
 

returns fudge factor for drift time error.

float TMDC::fudgeFactor float   )  [inline]
 

sets/returns fudge factor for drift time error.

00298                          {
00299     return _fudgeFactor = a;
00300 }

float TMDC::fudgeFactor void   )  const [inline]
 

returns fudge factor for drift time error.

00292                             {
00293     return _fudgeFactor;
00294 }

TMDC* TMDC::getTMDC void   )  [static]
 

TMDC* TMDC::getTMDC const std::string &  cdcVersion  )  [static]
 

returns TMDC object.

TMDC * TMDC::getTMDC void   )  [static]
 

00095                   {
00096     if (! _cdc) _cdc = new TMDC("1.0");
00097     return _cdc;
00098 }

TMDC * TMDC::getTMDC const std::string &  cdcVersion  )  [static]
 

returns TMDC object.

00089                                        {
00090     if (! _cdc) _cdc = new TMDC(version);
00091     return _cdc;
00092 }

const AList<TMDCWireHit>& TMDC::hits unsigned  mask = 0  )  const
 

returns a list of TMDCWireHit. 'update()' must be called before calling this function.

const AList< TMDCWireHit > & TMDC::hits unsigned  mask = 0  )  const
 

returns a list of TMDCWireHit. 'update()' must be called before calling this function.

00534                               {
00535     if (! mask) return _hits;
00536     else if (mask == WireHitFindingValid) return _hits;
00537     std::cout << "TMDC::hits !!! unsupported mask given" << std::endl;
00538     return _hits;
00539 }

const AList<TMDCWireHitMC>& TMDC::hitsMC void   )  const
 

returns a list of TMDCWireHitMC. 'updateMC()' must be called before calling this function.

const AList< TMDCWireHitMC > & TMDC::hitsMC void   )  const [inline]
 

returns a list of TMDCWireHitMC. 'updateMC()' must be called before calling this function.

00265                        {
00266     return _hitsMC;
00267 }

virtual void TUpdater::initialize void   )  [virtual, inherited]
 

initializes an object.

void TUpdater::initialize void   )  [inline, virtual, inherited]
 

initializes an object.

00082                          {
00083     _init = true;
00084 }

virtual bool TUpdater::initialized void   )  const [virtual, inherited]
 

returns true if an object is initialized.

bool TUpdater::initialized void   )  const [inline, virtual, inherited]
 

returns true if an object is initialized.

00076                                 {
00077     return _init;
00078 }

const TMDCLayer* const TMDC::layer unsigned  id  )  const
 

returns a pointer to a layer. 0 will be returned if 'id' is invalid.

const TMDCLayer *const TMDC::layer unsigned  id  )  const [inline]
 

returns a pointer to a layer. 0 will be returned if 'id' is invalid.

00259                              {
00260     return _layers[id];
00261 }

unsigned TMDC::layerId unsigned  axialStereo,
unsigned  axialStereoLayerId
[static]
 

unsigned TMDC::layerId const MdcGeoWire const  )  [static]
 

unsigned TMDC::layerId unsigned  wireId  )  [static]
 

unsigned TMDC::layerId unsigned  axialStereo,
unsigned  axialStereoLayerId
[static]
 

01004                                       {
01005 
01006     //...Axial case...
01007     if (as == 0) {
01008         if (id < 12) return id + 8;
01009         else if (id < 19) return id + 24;
01010         return 9999;
01011     }
01012 
01013     //...Stereo case...
01014     if (id < 8) return id;
01015     else if (id < 24) return id + 12;
01016     return 9999;
01017 }

unsigned TMDC::layerId const MdcGeoWire const  )  [static]
 

00661                                         {
00662     if (! w) return 9999;
00663     //zsl    unsigned id = w->Id();
00664     //    return layerId(id);
00665     return w->Layer();
00666 }

unsigned TMDC::layerId unsigned  wireId  )  [static]
 

00598                          {
00599 //    int length = _wires.length();
00600 //    if(id < length) return _wires[id]->geocdc()->Layer();
00601 //    return 9999;    
00602 
00603     if (id < 40) return 0;
00604     else if (id < 84) return 1;
00605     else if (id < 132) return 2;
00606     else if (id < 188) return 3;
00607 
00608     else if (id < 252) return 4;
00609     else if (id < 324) return 5;
00610     else if (id < 404) return 6;
00611     else if (id < 484) return 7;
00612 
00613     else if (id < 560) return 8;
00614     else if (id < 636) return 9;
00615     else if (id < 724) return 10;
00616     else if (id < 812) return 11;
00617 
00618     else if (id < 912) return 12;
00619     else if (id < 1012) return 13;
00620     else if (id < 1124) return 14;
00621     else if (id < 1236) return 15;
00622 
00623     else if (id < 1364) return 16;
00624     else if (id < 1492) return 17;
00625     else if (id < 1632) return 18;
00626     else if (id < 1772) return 19;
00627 
00628     else if (id < 1932) return 20;
00629     else if (id < 2092) return 21;
00630     else if (id < 2252) return 22;
00631     else if (id < 2412) return 23;
00632 
00633     else if (id < 2604) return 24;
00634     else if (id < 2796) return 25;
00635     else if (id < 2988) return 26;
00636     else if (id < 3180) return 27;
00637 
00638     else if (id < 3388) return 28;
00639     else if (id < 3596) return 29;
00640     else if (id < 3804) return 30;
00641     else if (id < 4012) return 31;
00642 
00643     else if (id < 4252) return 32;
00644     else if (id < 4492) return 33;
00645     else if (id < 4732) return 34;
00646     else if (id < 4972) return 35;
00647 
00648     else if (id < 5228) return 36;
00649     else if (id < 5484) return 37;
00650     else if (id < 5740) return 38;
00651     else if (id < 5996) return 39;
00652 
00653     else if (id < 6284) return 40;
00654     else if (id < 6572) return 41;
00655     else if (id < 6860) return 42;
00656 
00657     return 9999;    
00658 }

unsigned TMDC::localId const MdcGeoWire const  )  [static]
 

unsigned TMDC::localId unsigned  wireId  )  [static]
 

unsigned TMDC::localId const MdcGeoWire const  )  [static]
 

00750                                         {
00751     if (! w) return 9999;
00752 //    unsigned id = w->Id();
00753 //    return localId(id);
00754     return w->Cell();    
00755 }

unsigned TMDC::localId unsigned  wireId  )  [static]
 

00676                          {
00677     if (id < 40) return id;
00678     else if (id < 84) return id-40;
00679     else if (id < 132) return id-84;
00680     else if (id < 188) return id-132;
00681 
00682     else if (id < 252) return id-188;
00683     else if (id < 324) return id-252;
00684     else if (id < 404) return id-324;
00685     else if (id < 484) return id-404;
00686 
00687     else if (id < 560) return id-484;
00688     else if (id < 636) return id-560;
00689     else if (id < 724) return id-636;
00690     else if (id < 812) return id-724;
00691 
00692     else if (id < 912) return id-812;
00693     else if (id < 1012) return id-912;
00694     else if (id < 1124) return id-1012;
00695     else if (id < 1236) return id-1124;
00696 
00697     else if (id < 1364) return id-1236;
00698     else if (id < 1492) return id-1364;
00699     else if (id < 1632) return id-1492;
00700     else if (id < 1772) return id-1632;
00701 
00702     else if (id < 1932) return id-1772;
00703     else if (id < 2092) return id-1932;
00704     else if (id < 2252) return id-2092;
00705     else if (id < 2412) return id-2252;
00706 
00707     else if (id < 2604) return id-2412;
00708     else if (id < 2796) return id-2604;
00709     else if (id < 2988) return id-2796;
00710     else if (id < 3180) return id-2988;
00711 
00712     else if (id < 3388) return id-3180;
00713     else if (id < 3596) return id-3388;
00714     else if (id < 3804) return id-3596;
00715     else if (id < 4012) return id-3804;
00716 
00717     else if (id < 4252) return id-4012;
00718     else if (id < 4492) return id-4252;
00719     else if (id < 4732) return id-4492;
00720     else if (id < 4972) return id-4732;
00721 
00722     else if (id < 5228) return id-4972;
00723     else if (id < 5484) return id-5228;
00724     else if (id < 5740) return id-5484;
00725     else if (id < 5996) return id-5740;
00726 
00727     else if (id < 6284) return id-5996;
00728     else if (id < 6572) return id-6284;
00729     else if (id < 6860) return id-6572;
00730 
00731     return 9999;    
00732  
00733 /*    if (id < 384) return id % 64;
00734     else if (id < 624) return (id - 384) % 80;
00735     else if (id < 1200) return (id - 624) % 96;
00736     else if (id < 1584) return (id - 1200) % 128;
00737     else if (id < 2304) return (id - 1584) % 144;
00738     else if (id < 2944) return (id - 2304) % 160;
00739     else if (id < 3904) return (id - 2944) % 176;
00740     else if (id < 4736) return (id - 3904) % 208;
00741     else if (id < 5936) return (id - 4736) % 240;
00742     else if (id < 6960) return (id - 5936) % 256;
00743     else if (id < 8400) return (id - 6960) % 288;
00744 
00745     return 9999;
00746 */
00747 }

unsigned TMDC::localLayerId const MdcGeoLayer const  )  [static]
 

unsigned TMDC::localLayerId const MdcGeoWire const  )  [static]
 

unsigned TMDC::localLayerId unsigned  wireId  )  [static]
 

unsigned TMDC::localLayerId const MdcGeoLayer const  )  [static]
 

00919                                               {
00920     if (! l) return 9999;
00921     unsigned id = l->Id();
00922     if (id < 44) return id%4;      
00923     return 9999;
00924     
00925 /*    if (id < 1) return 0;
00926     else if (id < 2) return 1;
00927     else if (id < 3) return 2;
00928     else if (id < 4) return 3;
00929     else if (id < 5) return 4;
00930     else if (id < 6) return 5;
00931 
00932     else if (id < 7) return 0;
00933     else if (id < 8) return 1;
00934     else if (id < 9) return 2;
00935 
00936     else if (id < 10) return 0;
00937     else if (id < 11) return 1;
00938     else if (id < 12) return 2;
00939     else if (id < 13) return 3;
00940     else if (id < 14) return 4;
00941     else if (id < 15) return 5;
00942 
00943     else if (id < 16) return 0;
00944     else if (id < 17) return 1;
00945     else if (id < 18) return 2;
00946 
00947     else if (id < 19) return 0;
00948     else if (id < 20) return 1;
00949     else if (id < 21) return 2;
00950     else if (id < 22) return 3;
00951     else if (id < 23) return 4;
00952 
00953     else if (id < 24) return 0;
00954     else if (id < 25) return 1;
00955     else if (id < 26) return 2;
00956     else if (id < 27) return 3;
00957 
00958     else if (id < 28) return 0;
00959     else if (id < 29) return 1;
00960     else if (id < 30) return 2;
00961     else if (id < 31) return 3;
00962     else if (id < 32) return 4;
00963 
00964     else if (id < 33) return 0;
00965     else if (id < 34) return 1;
00966     else if (id < 35) return 2;
00967     else if (id < 36) return 3;
00968 
00969     else if (id < 37) return 0;
00970     else if (id < 38) return 1;
00971     else if (id < 39) return 2;
00972     else if (id < 40) return 3;
00973     else if (id < 41) return 4;
00974 
00975     else if (id < 42) return 0;
00976     else if (id < 43) return 1;
00977     else if (id < 44) return 2;
00978     else if (id < 45) return 3;
00979 
00980     else if (id < 46) return 0;
00981     else if (id < 47) return 1;
00982     else if (id < 48) return 2;
00983     else if (id < 49) return 3;
00984     else if (id < 50) return 4;
00985 
00986     return 9999;    
00987 */
00988 }

unsigned TMDC::localLayerId const MdcGeoWire const  )  [static]
 

00903                                              {
00904     if (! w) return 9999;
00905     return w->Layer()%4;
00906     
00907 //    unsigned id = w->Id();
00908 //    return localLayerId(id);
00909 }

unsigned TMDC::localLayerId unsigned  wireId  )  [static]
 

00833                               {
00834     if(id < 6860) return layerId(id)%4;
00835     return 9999;
00836     
00837 /*    if (id < 64) return 0;
00838     else if (id < 128) return 1;
00839     else if (id < 192) return 2;
00840     else if (id < 256) return 3;
00841     else if (id < 320) return 4;
00842     else if (id < 384) return 5;
00843 
00844     else if (id < 464) return 0;
00845     else if (id < 544) return 1;
00846     else if (id < 624) return 2;
00847 
00848     else if (id < 720) return 0;
00849     else if (id < 816) return 1;
00850     else if (id < 912) return 2;
00851     else if (id < 1008) return 3;
00852     else if (id < 1104) return 4;
00853     else if (id < 1200) return 5;
00854 
00855     else if (id < 1328) return 0;
00856     else if (id < 1456) return 1;
00857     else if (id < 1584) return 2;
00858 
00859     else if (id < 1728) return 0;
00860     else if (id < 1872) return 1;
00861     else if (id < 2016) return 2;
00862     else if (id < 2160) return 3;
00863     else if (id < 2304) return 4;
00864 
00865     else if (id < 2464) return 0;
00866     else if (id < 2624) return 1;
00867     else if (id < 2784) return 2;
00868     else if (id < 2944) return 3;
00869 
00870     else if (id < 3136) return 0;
00871     else if (id < 3328) return 1;
00872     else if (id < 3520) return 2;
00873     else if (id < 3712) return 3;
00874     else if (id < 3904) return 4;
00875 
00876     else if (id < 4112) return 0;
00877     else if (id < 4320) return 1;
00878     else if (id < 4528) return 2;
00879     else if (id < 4736) return 3;
00880 
00881     else if (id < 4976) return 0;
00882     else if (id < 5216) return 1;
00883     else if (id < 5456) return 2;
00884     else if (id < 5696) return 3;
00885     else if (id < 5936) return 4;
00886 
00887     else if (id < 6192) return 0;
00888     else if (id < 6448) return 1;
00889     else if (id < 6704) return 2;
00890     else if (id < 6960) return 3;
00891 
00892     else if (id < 7248) return 0;
00893     else if (id < 7536) return 1;
00894     else if (id < 7824) return 2;
00895     else if (id < 8112) return 3;
00896     else if (id < 8400) return 4;
00897 
00898     return 9999;    
00899 */
00900 }

std::string TMDC::name void   )  const
 

returns name.

std::string TMDC::name void   )  const
 

returns name.

00076                      {
00077     return "TMDC";
00078 }

unsigned TMDC::nLayers void   )  const
 

unsigned TMDC::nLayers void   )  const [inline]
 

00322                         {
00323     return _nLayers;
00324 }

unsigned TMDC::nLocalLayer unsigned  superLayerId  )  const
 

returns # of wire layers in a super layer. 0 will be returned if 'superLayerId' is invalid.

unsigned TMDC::nLocalLayer unsigned  superLayerId  )  const [inline]
 

returns # of wire layers in a super layer. 0 will be returned if 'superLayerId' is invalid.

00251                                              {
00252     AList<TMDCLayer> * superLayer = _superLayers[superLayerId];
00253     if (! superLayer) return 0;
00254     return superLayer->length();
00255 }

unsigned TMDC::nSuperLayers void   )  const
 

unsigned TMDC::nSuperLayers void   )  const [inline]
 

00316                              {
00317     return _nSuperLayers;
00318 }

unsigned TMDC::nWires void   )  const
 

unsigned TMDC::nWires void   )  const [inline]
 

00310                        {
00311     return _nWires;
00312 }

float TMDC::phi float  phi  )  [static]
 

float TMDC::phi float  phi  )  [inline, static]
 

00283                  {
00284     static const float pi2 = 2. * M_PI;
00285     a = std::fmod(a, pi2);
00286     if (a < 0.) return a + pi2;
00287     return a;
00288 }

const AList<TMDCWireHit>& TMDC::stereoHits unsigned  mask = 0  )  const
 

returns a list of stereo hits. 'update()' must be called before calling this function.

const AList< TMDCWireHit > & TMDC::stereoHits unsigned  mask = 0  )  const
 

returns a list of stereo hits. 'update()' must be called before calling this function.

00526                                     {
00527     if (! mask) return _stereoHits;
00528     else if (mask == WireHitFindingValid) return _stereoHits;
00529     std::cout << "TMDC::stereoHits !!! unsupported mask given" << std::endl;
00530     return _stereoHits;
00531 }

const AList<TMDCLayer>* const TMDC::superLayer unsigned  id  )  const
 

returns a pointer to a super-layer. 0 will be returned if 'id' is invalid.

const AList< TMDCLayer > *const TMDC::superLayer unsigned  id  )  const [inline]
 

returns a pointer to a super-layer. 0 will be returned if 'id' is invalid.

00271                                   {
00272     return _superLayers[id];
00273 }

unsigned TMDC::superLayerId const MdcGeoLayer const  )  [static]
 

unsigned TMDC::superLayerId const MdcGeoWire const  )  [static]
 

unsigned TMDC::superLayerId unsigned  wireId  )  [static]
 

unsigned TMDC::superLayerId const MdcGeoLayer const  )  [static]
 

00810                                               {
00811     if (! l) return 9999;
00812     unsigned id = l->Id();
00813 
00814     if(id < 44) return id/4;
00815     return 9999;     
00816 /*    if (id < 6) return 0;
00817     else if (id < 9) return 1;
00818     else if (id < 15) return 2;
00819     else if (id < 18) return 3;
00820     else if (id < 23) return 4;
00821     else if (id < 27) return 5;
00822     else if (id < 32) return 6;
00823     else if (id < 36) return 7;
00824     else if (id < 41) return 8;
00825     else if (id < 45) return 9;
00826     else if (id < 50) return 10;
00827 
00828     return 9999;
00829 */
00830 }

unsigned TMDC::superLayerId const MdcGeoWire const  )  [static]
 

00796                                              {
00797     if (! w) return 9999;
00798     unsigned id = w->Id();
00799     return superLayerId(id);
00800 }

unsigned TMDC::superLayerId unsigned  wireId  )  [static]
 

00765                               {
00766     if (id < 188) return 0;
00767     else if (id < 484) return 1;
00768     else if (id < 812) return 2;
00769     else if (id < 1236) return 3;
00770     else if (id < 1772) return 4;
00771     else if (id < 2412) return 5;
00772     else if (id < 3180) return 6;
00773     else if (id < 4012) return 7;
00774     else if (id < 4972) return 8;
00775     else if (id < 5996) return 9;
00776     else if (id < 6860) return 10;
00777  
00778     return 9999;    
00779 /*    if (id < 384) return 0;
00780     else if (id < 624) return 1;
00781     else if (id < 1200) return 2;
00782     else if (id < 1584) return 3;
00783     else if (id < 2304) return 4;
00784     else if (id < 2944) return 5;
00785     else if (id < 3904) return 6;
00786     else if (id < 4736) return 7;
00787     else if (id < 5936) return 8;
00788     else if (id < 6960) return 9;
00789     else if (id < 8400) return 10;
00790 
00791     return 9999;
00792 */
00793 }

void TUpdater::update void   )  [virtual, inherited]
 

updates an object.

00037                      {
00038     if (updated()) return;
00039 
00040    /*
00041     struct belle_event * ev = 
00042         (struct belle_event *) BsGetEnt(BELLE_EVENT, 1, BBS_No_Index);
00043 
00044     //...No BELLE_EVENT ???...
00045     if (! ev) return;
00046   
00047     _expN = ev->m_ExpNo;
00048     _runN = ev->m_RunNo;
00049     _evtN = ev->m_EvtNo;
00050    */
00051     _expN = 1;
00052     _runN = 1;
00053     _evtN = 1;
00054 }

void TMDC::update bool  mcAnalysis = true  ) 
 

updates TMDC information. clear() is called in this function.

void TMDC::update bool  mcAnalysis = true  ) 
 

updates TMDC information. clear() is called in this function.

00317                             {
00318     //...Already updated?...
00319 //zsl    if (updated()) return;
00320 
00321     //...Clear old information...
00322     fastClear();
00323 
00324     //...Loop over RECMDC_WIRHIT bank...
00325 //    unsigned nReccdc = BsCouTab(RECMDC_WIRHIT);
00326      unsigned nReccdc = MdcRecWirhitCol::getMdcRecWirhitCol()->size();
00327 #ifdef TRKRECO_DEBUG
00328     cout<<"size of MdcRecWirhit:"<<nReccdc<<endl;   
00329 #endif
00330     for (unsigned i = 0; i < nReccdc; i++) {
00331 //      struct reccdc_wirhit * h =
00332 //          (struct reccdc_wirhit *)
00333 //          BsGetEnt(RECMDC_WIRHIT, i + 1, BBS_No_Index);
00334         MdcRec_wirhit* h = &(*MdcRecWirhitCol::getMdcRecWirhitCol())[i]; 
00335         //...Check validity...
00336 //zsl   if (! (h->stat & WireHitFindingValid)) continue;
00337 
00338         //...Obtain a pointer to GEOMDC...
00339 //      struct geocdc_wire * g =
00340 //          (struct geocdc_wire *)
00341 //          BsGetEnt(GEOMDC_WIRE, h->m_geo, BBS_No_Index);
00342         const MdcGeoWire* g = h->geo;
00343 //      if (_newCdc)
00344 //          if (g->m_ID < 256)
00345 //              continue;
00346 
00347         //...Get a pointer to a TMDCWire...
00348 //      TMDCWire * w = _wires[g->m_ID - 1];
00349         TMDCWire * w = _wires[g->Id()];   
00350         _hitWires.append(w);
00351 
00352         //...Create TMDCWireHit...
00353         TMDCWireHit * hit = new TMDCWireHit(w, h, _fudgeFactor);
00354         _hits.append(hit);
00355 
00356         //... update the wirehit pointer in the TMDCWire  (by zang shilei)
00357         w->hit(hit);
00358        //if (w->hit()) cout<<"test .......... right~~~~~"<<endl; 
00359         
00360         //...Axial or stereo...
00361         if (w->axial()) _axialHits.append(hit);
00362         else            _stereoHits.append(hit);
00363     }
00364             
00365     //...Hit classfication...
00366     classification();
00367 
00368     //...MC information...
00369     if (mcAnalysis) updateMC();
00370 
00371     //...Update information...
00372     TUpdater::update();
00373 }

virtual bool TUpdater::updated void   )  const [virtual, inherited]
 

returns true if an object is updated.

bool TUpdater::updated void   )  const [virtual, inherited]
 

returns true if an object is updated.

00057                             {
00058     /*
00059     struct belle_event * ev = 
00060         (struct belle_event *) BsGetEnt(BELLE_EVENT, 1, BBS_No_Index);
00061 
00062     //...No BELLE_EVENT ???...
00063     if (! ev) return false;
00064 
00065     //...Same event?...
00066     if (_expN == ev->m_ExpNo &&
00067         _runN == ev->m_RunNo &&
00068         _evtN == ev->m_EvtNo) return true;
00069     */
00070 
00071    if (_expN == 1 &&
00072        _runN == 1 &&
00073        _evtN == 1) return true;
00074 
00075    return false;
00076 }

void TMDC::updateMC void   ) 
 

updates TMDC information for MC.

void TMDC::updateMC void   ) 
 

updates TMDC information for MC.

00376                    {
00377 
00378     //...Create TTrackHEP...
00379     TTrackHEP::update();
00380 
00381     //...Loop over DATMDC_MCWIRHIT bank...
00382     unsigned n = 0;
00383 //    for (unsigned i = 0; i < BsCouTab(DATMDC_MCWIRHIT); i++) {
00384     for (unsigned i = 0; i < MdcDatMcwirhitCol::getMdcDatMcwirhitCol()->size(); i++) {   
00385 //        struct datcdc_mcwirhit * h =
00386 //          (struct datcdc_mcwirhit *)
00387 //          BsGetEnt(DATMDC_MCWIRHIT, i + 1, BBS_No_Index);
00388         MdcDat_mcwirhit* h = &(*MdcDatMcwirhitCol::getMdcDatMcwirhitCol())[i];
00389         //...Get a pointer to RECMDC_WIRHIT...
00390 //      reccdc_wirhit * whp =
00391 //          (reccdc_wirhit *) BsGetEnt(RECMDC_WIRHIT, h->m_dat, BBS_No_Index);
00392         MdcRec_wirhit* whp = h->dat->rec;
00393         //...Get TrkReco objects...
00394         TMDCWireHit * wh = 0;
00395         TMDCWire * w = 0;
00396         if (whp) {
00397             if (whp->stat & WireHitFindingValid) {
00398                 unsigned n = _hits.length();
00399                 unsigned j = (whp->id < n) ? whp->id : n;
00400                 while (j) {
00401                     --j;
00402                     if (_hits[j]->reccdc() == whp) {
00403                         wh = _hits[j];
00404                         w = _wires[wh->wire()->id()];
00405                         break;
00406                     }
00407                 }
00408             }
00409         }
00410         if (! w) {
00411 //          geocdc_wire * g =
00412 //              (geocdc_wire *) BsGetEnt(GEOMDC_WIRE, h->m_geo, BBS_No_Index);
00413 //          w = _wires[g->m_ID - 1];
00414           const MdcGeoWire* g = h->geo;
00415         }
00416 
00417         //...Create TMDCWireHitMC...
00418         TMDCWireHitMC * hit = new TMDCWireHitMC(w, wh, h);
00419         _hitsMC.append(hit);
00420         w->hit(hit);
00421         if (wh) wh->mc(hit);
00422 
00423         //...TTrackHEP...
00424 //      TTrackHEP * hep = TTrackHEP::list()[h->m_hep - 1];
00425         TTrackHEP * hep = TTrackHEP::list()[h->hep->id];     
00426         hit->_hep = hep;
00427         if (hep) hep->_hits.append(hit);
00428         else {
00429             std::cout << "TMDC::updateMC !!! mission impossible" << std::endl;
00430             std::cout << "                   This error will cause TrkReco crush";
00431             std::cout << std::endl;
00432 #ifdef TRKRECO_DEBUG_DETAIL
00433             cout << "    h->m_hep, h->m_hep -1 = " << h->m_hep;
00434             std::cout << ", " << h->m_hep - 1 << std::endl;
00435             std::cout << "    TTrackHEP list length = ";
00436             std::cout << TTrackHEP::list().length() << std::endl;
00437 //          BsShwDat(GEN_HEPEVT);
00438 //          BsShwDat(DATMDC_MCWIRHIT);
00439 #endif
00440         }
00441     }
00442 }

std::string TMDC::version void   )  const
 

returns version.

std::string TMDC::version void   )  const
 

returns version.

00081                         {
00082     return "2.18";
00083 }

const TMDCWire* const TMDC::wire float  r,
float  phi
const
 

returns a pointer to a wire.

const TMDCWire* const TMDC::wire const HepPoint3D point  )  const
 

returns a pointer to a wire.

const TMDCWire* const TMDC::wire unsigned  layerId,
int  localId
const
 

returns a pointer to a wire. 'localId' can be negative. 0 will be returned if 'layerId' is invalid.

const TMDCWire* const TMDC::wire unsigned  wireId  )  const
 

returns a pointer to a wire. 0 will be returned if 'wireId' is invalid.

const TMDCWire *const TMDC::wire float  r,
float  phi
const
 

returns a pointer to a wire.

00257                                  {
00258 
00259     std::cout << "r,phi = " << r << "," << p << std::endl;
00260 
00261     unsigned id = 25;
00262     bool ok = false;
00263     const TMDCLayer * l;
00264     while (! ok) {
00265         l = layer(id);
00266         if (! l) return NULL;
00267         
00268         const MdcGeoLayer * geo = l->geocdc();
00269         if (geo->Radius()/10 + geo->RCSiz2()/10 < r) ++id;
00270         else if (geo->Radius()/10 - geo->RCSiz1()/10 > r) --id;
00271         else ok = true;
00272     }
00273 //    float dPhi = 2. * M_PI / float(l->nWires());
00274 //    if (l->geocdc()->m_offset > 0.) p -= dPhi / 2.;
00275     float dPhi = 2. * M_PI / float(l->nWires());   
00276     p -= l->geocdc()->Offset()/dPhi; 
00277     unsigned localId = unsigned(phi(p) / dPhi);
00278     return l->wire(localId);
00279 }

const TMDCWire *const TMDC::wire const HepPoint3D point  )  const
 

returns a pointer to a wire.

00250                                      {
00251     float r = p.mag();
00252     float phi = p.phi();
00253     return wire(r, phi);
00254 }

const TMDCWire *const TMDC::wire unsigned  layerId,
int  localId
const
 

returns a pointer to a wire. 'localId' can be negative. 0 will be returned if 'layerId' is invalid.

00242                                               {
00243     if (layerId < _nLayers)
00244         return _layers[layerId]->wire(localId);
00245 
00246     return NULL;
00247 }

const TMDCWire *const TMDC::wire unsigned  wireId  )  const [inline]
 

returns a pointer to a wire. 0 will be returned if 'wireId' is invalid.

00277                             {
00278     return _wires[id];
00279 }

std::string TMDC::wireName const MdcRec_wirhit  )  [static]
 

std::string TMDC::wireName const MdcGeoWire const  )  [static]
 

std::string TMDC::wireName unsigned  wireId  )  [static]
 

std::string TMDC::wireName const MdcRec_wirhit  )  [static]
 

01020                                       {
01021 //    geocdc_wire * g = (geocdc_wire *) BsGetEnt(GEOMDC_WIRE,
01022 //                                             h.m_geo,
01023 //                                             BBS_No_Index);
01024       const MdcGeoWire* g = h.geo;
01025       return wireName(g);
01026 }

std::string TMDC::wireName const MdcGeoWire const  )  [static]
 

00583                                          {
00584     if (! w) return std::string("no such a wire");
00585 //    unsigned id = w->m_ID - 1;
00586     unsigned id = w->Id();
00587     return wireName(id);
00588 }

std::string TMDC::wireName unsigned  wireId  )  [static]
 

00575                               {
00576     if (superLayerId(wireId) % 2)
00577         return itostring(layerId(wireId)) + "=" +
00578             itostring(localId(wireId));
00579     return itostring(layerId(wireId)) + "-" + itostring(localId(wireId));
00580 }


Member Data Documentation

AList<TMDCWireHit> TMDC::_axialHits [private]
 

AList<TMDCWireHit> TMDC::_axialHits [private]
 

AList<TMDCWireHit> TMDC::_badHits [private]
 

AList<TMDCWireHit> TMDC::_badHits [private]
 

TMDC* TMDC::_cdc [static, private]
 

TMDC * TMDC::_cdc = 0 [static, private]
 

const std::string TMDC::_cdcVersion [private]
 

int TMDC::_debugLevel [private]
 

float TMDC::_fudgeFactor [private]
 

AList<TMDCWireHit> TMDC::_hits [private]
 

AList<TMDCWireHit> TMDC::_hits [private]
 

AList<TMDCWireHitMC> TMDC::_hitsMC [private]
 

AList<TMDCWireHitMC> TMDC::_hitsMC [private]
 

AList<TMDCWire> TMDC::_hitWires [private]
 

AList<TMDCWire> TMDC::_hitWires [private]
 

AList<TMDCLayer> TMDC::_layers [private]
 

AList<TMDCLayer> TMDC::_layers [private]
 

const bool TMDC::_newCdc [private]
 

const unsigned TMDC::_nLayers [private]
 

const unsigned TMDC::_nSuperLayers [private]
 

const unsigned TMDC::_nWires [private]
 

AList<TMDCWireHit> TMDC::_stereoHits [private]
 

AList<TMDCWireHit> TMDC::_stereoHits [private]
 

AList< AList<TMDCLayer> > TMDC::_superLayers [private]
 

AList< AList<TMDCLayer> > TMDC::_superLayers [private]
 

AList<TMDCWire> TMDC::_wires [private]
 

AList<TMDCWire> TMDC::_wires [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 18:54:24 2011 for BOSS6.5.5 by  doxygen 1.3.9.1