TMDC Class Reference

#include <TMDC.h>

Inheritance diagram for TMDC:

TUpdater List of all members.

Public Member Functions

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

Static Public Member Functions

static TMDCgetTMDC (const std::string &cdcVersion)
 returns TMDC object.
static TMDCgetTMDC (void)
static std::string wireName (unsigned wireId)
static std::string wireName (const MdcGeoWire *const)
static std::string wireName (const MdcRec_wirhit &)
static unsigned layerId (unsigned wireId)
static unsigned layerId (const MdcGeoWire *const)
static unsigned localId (unsigned wireId)
static unsigned localId (const MdcGeoWire *const)
static unsigned superLayerId (unsigned wireId)
static unsigned superLayerId (const MdcGeoWire *const)
static unsigned superLayerId (const MdcGeoLayer *const)
static unsigned localLayerId (unsigned wireId)
static unsigned localLayerId (const MdcGeoWire *const)
static unsigned localLayerId (const MdcGeoLayer *const)
static unsigned axialStereoLayerId (const MdcGeoLayer *const)
static unsigned layerId (unsigned axialStereo, unsigned axialStereoLayerId)
static float phi (float phi)
static 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)

Private Member Functions

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

Private Attributes

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

Static Private Attributes

static TMDC_cdc = 0

Detailed Description

A class to represent MDC.

The instance of TMDC is a singleton. 'TMDCgetTMDC()' 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.

Definition at line 61 of file TMDC.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 100 of file TMDC.cxx.

References _cdcVersion, _layers, _nLayers, _nSuperLayers, _superLayers, _wires, GMDC, genRecEmupikp::i, ganga-rec::j, layer(), IMdcGeomSvc::Layer(), nWires(), TMDCLayer::superLayerId(), w, and IMdcGeomSvc::Wire().

Referenced by getTMDC().

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 }


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.

Definition at line 518 of file TMDC.cxx.

References _axialHits, and WireHitFindingValid.

Referenced by TrkReco::execute().

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]

Definition at line 991 of file TMDC.cxx.

References MdcGeoLayer::Id().

Referenced by TMDCLayer::TMDCLayer().

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).

Definition at line 542 of file TMDC.cxx.

References _badHits, _fudgeFactor, _wires, MdcRecWirhitCol::getMdcRecWirhitCol(), genRecEmupikp::i, TUpdater::update(), TUpdater::updated(), w, and WireHitFindingValid.

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 [inline]

returns MDC version.

Definition at line 304 of file TMDC.h.

References _cdcVersion, and deljobs::string.

Referenced by dump().

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

void TMDC::classification ( void   ) 

classify hits.

Definition at line 445 of file TMDC.cxx.

References _hits, TMDCWire::hit(), genRecEmupikp::i, ganga-rec::j, TMDCWire::neighbor(), next, superLayer(), w, WireHitContinuous, WireHitIsolated, WireHitNeighborHit, WireHitPatternLeft, and WireHitPatternRight.

Referenced by update().

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.

Definition at line 282 of file TMDC.cxx.

References _axialHits, _badHits, _hits, _hitsMC, _hitWires, _stereoHits, _wires, TUpdater::clear(), genRecEmupikp::i, and w.

Referenced by fastClear().

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   )  [inline]

sets debug level.

Definition at line 245 of file TMDC.h.

References _debugLevel.

00245                       {
00246     return _debugLevel = a;
00247 }

int TMDC::debugLevel ( void   )  const [inline]

returns debug level.

Definition at line 239 of file TMDC.h.

References _debugLevel.

Referenced by TrkReco::cdcInit().

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)

Definition at line 1029 of file TMDC.cxx.

References abs, TMDCWireHit::dDrift(), TMLink::dDrift(), check_raw_filter::dist, TMLink::dPhi(), TMDCWireHit::drift(), TMLink::drift(), TMLink::hit(), TMDCWire::id(), TMLink::positionOnWire(), TMDCWireHit::reccdc(), s, t(), MdcRec_wirhit::tdc, TMDCWireHit::wire(), wire(), and x.

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.

Definition at line 26 of file TUpdater.cxx.

References TUpdater::_evtN, TUpdater::_expN, TUpdater::_runN, and TUpdater::updated().

Referenced by main().

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.

Definition at line 181 of file TMDC.cxx.

References _axialHits, _debugLevel, _hits, _layers, _nLayers, _nWires, _stereoHits, _superLayers, _wires, cdcVersion(), genRecEmupikp::i, name(), RealDBUtil::npos, deljobs::string, and version().

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.

Definition at line 298 of file TMDC.cxx.

References _axialHits, _badHits, _hits, _hitsMC, _hitWires, _stereoHits, TUpdater::clear(), clear(), genRecEmupikp::i, and w.

Referenced by TrkReco::finalize(), and update().

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   )  [inline]

sets/returns fudge factor for drift time error.

Definition at line 298 of file TMDC.h.

References _fudgeFactor.

00298                          {
00299     return _fudgeFactor = a;
00300 }

float TMDC::fudgeFactor ( void   )  const [inline]

returns fudge factor for drift time error.

Definition at line 292 of file TMDC.h.

References _fudgeFactor.

Referenced by TrkReco::cdcInit().

00292                             {
00293     return _fudgeFactor;
00294 }

TMDC * TMDC::getTMDC ( void   )  [static]

Definition at line 95 of file TMDC.cxx.

References _cdc, and TMDC().

Referenced by TBuilder0::buildStereo(), TrkReco::cdcInit(), TConformalFinder::conformal2Wire(), TMDCTsf::createTsf(), TPerfectFinder::doit(), TSegment::expandSeg(), and TMDCWire::neighbor().

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

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

returns TMDC object.

Definition at line 89 of file TMDC.cxx.

References _cdc, and TMDC().

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.

Definition at line 534 of file TMDC.cxx.

References _hits, and WireHitFindingValid.

Referenced by TrkReco::execute().

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 [inline]

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

Definition at line 265 of file TMDC.h.

References _hitsMC.

Referenced by TPerfectFinder::doit().

00265                        {
00266     return _hitsMC;
00267 }

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

initializes an object.

Definition at line 82 of file TUpdater.h.

References TUpdater::_init.

00082                          {
00083     _init = true;
00084 }

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

returns true if an object is initialized.

Definition at line 76 of file TUpdater.h.

References TUpdater::_init.

00076                                 {
00077     return _init;
00078 }

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

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

Definition at line 259 of file TMDC.h.

References _layers.

Referenced by TMDCTsf::createTsf(), TSegment::expandSeg(), TrkReco::FillTuple(), TMDCWire::neighbor(), TMDC(), and wire().

00259                              {
00260     return _layers[id];
00261 }

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

Definition at line 1004 of file TMDC.cxx.

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]

Definition at line 661 of file TMDC.cxx.

References w.

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]

Definition at line 598 of file TMDC.cxx.

Referenced by localLayerId(), and wireName().

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]

Definition at line 750 of file TMDC.cxx.

References w.

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]

Definition at line 676 of file TMDC.cxx.

Referenced by wire(), and wireName().

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]

Definition at line 919 of file TMDC.cxx.

References MdcGeoLayer::Id().

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]

Definition at line 903 of file TMDC.cxx.

References w.

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]

Definition at line 833 of file TMDC.cxx.

References layerId().

Referenced by TMDCLayer::TMDCLayer().

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.

Definition at line 76 of file TMDC.cxx.

Referenced by dump().

00076                      {
00077     return "TMDC";
00078 }

unsigned TMDC::nLayers ( void   )  const [inline]

Definition at line 322 of file TMDC.h.

References _nLayers.

Referenced by TMDCWire::neighbor().

00322                         {
00323     return _nLayers;
00324 }

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

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

Definition at line 251 of file TMDC.h.

References _superLayers, and superLayer().

Referenced by TMDCTsf::create().

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

unsigned TMDC::nSuperLayers ( void   )  const [inline]

Definition at line 316 of file TMDC.h.

References _nSuperLayers.

00316                              {
00317     return _nSuperLayers;
00318 }

unsigned TMDC::nWires ( void   )  const [inline]

Definition at line 310 of file TMDC.h.

References _nWires.

Referenced by TMDC().

00310                        {
00311     return _nWires;
00312 }

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

Definition at line 283 of file TMDC.h.

References M_PI.

Referenced by wire().

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.

Definition at line 526 of file TMDC.cxx.

References _stereoHits, and WireHitFindingValid.

Referenced by TrkReco::execute().

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 [inline]

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

Definition at line 271 of file TMDC.h.

References _superLayers.

Referenced by TBuilder0::buildStereo(), classification(), and nLocalLayer().

00271                                   {
00272     return _superLayers[id];
00273 }

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

Definition at line 810 of file TMDC.cxx.

References MdcGeoLayer::Id().

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]

Definition at line 796 of file TMDC.cxx.

References superLayerId(), and w.

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

unsigned TMDC::superLayerId ( unsigned  wireId  )  [static]

Definition at line 765 of file TMDC.cxx.

Referenced by superLayerId(), TMDCLayer::TMDCLayer(), and wireName().

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.

Definition at line 37 of file TUpdater.cxx.

References TUpdater::_evtN, TUpdater::_expN, TUpdater::_runN, and TUpdater::updated().

Referenced by badHits(), main(), and update().

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.

Definition at line 317 of file TMDC.cxx.

References _axialHits, _fudgeFactor, _hits, _hitWires, _stereoHits, _wires, classification(), fastClear(), MdcRecWirhitCol::getMdcRecWirhitCol(), genRecEmupikp::i, MdcGeoWire::Id(), TUpdater::update(), updateMC(), and w.

Referenced by TrkReco::execute().

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 }

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

returns true if an object is updated.

Definition at line 57 of file TUpdater.cxx.

References TUpdater::_evtN, TUpdater::_expN, and TUpdater::_runN.

Referenced by badHits(), TUpdater::dump(), and TUpdater::update().

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.

Definition at line 376 of file TMDC.cxx.

References TTrackHEP::_hits, _hits, _hitsMC, _wires, MdcDatMcwirhitCol::getMdcDatMcwirhitCol(), genRecEmupikp::i, TMDCWire::id(), MdcRec_wirhit::id, ganga-rec::j, TTrackHEP::list(), TMDCWireHit::mc(), MdcRec_wirhit::stat, TTrackHEP::update(), w, TMDCWireHit::wire(), and WireHitFindingValid.

Referenced by update().

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.

Definition at line 81 of file TMDC.cxx.

Referenced by dump().

00081                         {
00082     return "2.18";
00083 }

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

returns a pointer to a wire.

Definition at line 257 of file TMDC.cxx.

References TMDCLayer::geocdc(), layer(), localId(), M_PI, TMDCLayer::nWires(), MdcGeoLayer::Offset(), phi(), MdcGeoLayer::Radius(), MdcGeoLayer::RCSiz1(), MdcGeoLayer::RCSiz2(), and TMDCLayer::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.

Definition at line 250 of file TMDC.cxx.

References phi(), and 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.

Definition at line 242 of file TMDC.cxx.

References _layers, and _nLayers.

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.

Definition at line 277 of file TMDC.h.

References _wires.

Referenced by TConformalFinder::conformal2Wire(), TMDCTsf::create(), driftDistance(), TMDCWire::neighbor(), and wire().

00277                             {
00278     return _wires[id];
00279 }

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

Definition at line 1020 of file TMDC.cxx.

References MdcRec_wirhit::geo, and wireName().

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]

Definition at line 583 of file TMDC.cxx.

References deljobs::string, w, and wireName().

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]

Definition at line 575 of file TMDC.cxx.

References layerId(), localId(), and superLayerId().

Referenced by wireName().

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]

Definition at line 220 of file TMDC.h.

Referenced by axialHits(), clear(), dump(), fastClear(), and update().

AList<TMDCWireHit> TMDC::_badHits [private]

Definition at line 222 of file TMDC.h.

Referenced by badHits(), clear(), and fastClear().

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

Definition at line 203 of file TMDC.h.

Referenced by getTMDC().

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

Definition at line 208 of file TMDC.h.

Referenced by cdcVersion(), and TMDC().

int TMDC::_debugLevel [private]

Definition at line 206 of file TMDC.h.

Referenced by debugLevel(), and dump().

float TMDC::_fudgeFactor [private]

Definition at line 214 of file TMDC.h.

Referenced by badHits(), fudgeFactor(), and update().

AList<TMDCWireHit> TMDC::_hits [private]

Definition at line 219 of file TMDC.h.

Referenced by classification(), clear(), dump(), fastClear(), hits(), update(), and updateMC().

AList<TMDCWireHitMC> TMDC::_hitsMC [private]

Definition at line 223 of file TMDC.h.

Referenced by clear(), fastClear(), hitsMC(), and updateMC().

AList<TMDCWire> TMDC::_hitWires [private]

Definition at line 218 of file TMDC.h.

Referenced by clear(), fastClear(), and update().

AList<TMDCLayer> TMDC::_layers [private]

Definition at line 216 of file TMDC.h.

Referenced by dump(), layer(), TMDC(), and wire().

const bool TMDC::_newCdc [private]

Definition at line 209 of file TMDC.h.

const unsigned TMDC::_nLayers [private]

Definition at line 212 of file TMDC.h.

Referenced by dump(), nLayers(), TMDC(), and wire().

const unsigned TMDC::_nSuperLayers [private]

Definition at line 211 of file TMDC.h.

Referenced by nSuperLayers(), and TMDC().

const unsigned TMDC::_nWires [private]

Definition at line 210 of file TMDC.h.

Referenced by dump(), and nWires().

AList<TMDCWireHit> TMDC::_stereoHits [private]

Definition at line 221 of file TMDC.h.

Referenced by clear(), dump(), fastClear(), stereoHits(), and update().

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

Definition at line 215 of file TMDC.h.

Referenced by dump(), nLocalLayer(), superLayer(), and TMDC().

AList<TMDCWire> TMDC::_wires [private]

Definition at line 217 of file TMDC.h.

Referenced by badHits(), clear(), dump(), TMDC(), update(), updateMC(), and wire().


Generated on Tue Nov 29 23:36:01 2016 for BOSS_7.0.2 by  doxygen 1.4.7