Presentation is loading. Please wait.

Presentation is loading. Please wait.

Luca Lista Object Oriented Reconstruction Software for the IFR Detector of B A B AR Experiment Luca Lista INFN, Sezione di Napoli for the BaBar Computing.

Similar presentations


Presentation on theme: "Luca Lista Object Oriented Reconstruction Software for the IFR Detector of B A B AR Experiment Luca Lista INFN, Sezione di Napoli for the BaBar Computing."— Presentation transcript:

1 Luca Lista Object Oriented Reconstruction Software for the IFR Detector of B A B AR Experiment Luca Lista INFN, Sezione di Napoli for the BaBar Computing Group

2 Luca Lista The Instrumented Flux Return of B A B AR Muon and K 0 L detector Planar IFR: –19 (18) layers of Resistive Plate Chambers (RPC) in the barrel (endcaps) –65 (60) cm of iron Inner RPC –2 layers of cylindrical RPC inside the coil The detector output consists of a digital strip pattern –charged: muon or charged hadron candidate –neutral: neutral hadron candidate

3 Luca Lista Reconstruction Object Model Objects encapsulate the behavior of: – reconstruction information (strip, hit, cluster,…) – the detector model (sector, layer, …) – algorithm strategies (clusterizer, …) – etc. strip “hit” : 1D-cluster

4 Luca Lista Cluster Object Model The IFR is segmented into sectors –6  sectors in the barrel –3 sectors in each end-cap half door (top, middle, bottom) –4  sectors in the inner RPC Ifr3DCluster:Ifr3DCluster: the basic planar cluster object reconstructed in a single sector. Easy geometry in local coordinates IfrInner3DCluster:IfrInner3DCluster: the stereo readout in the inner RPC requires a dedicated clustering to reduce ghost intersections Ifr3DComposite:Ifr3DComposite: a composite pattern generalizes a cluster reconstructed in more than one sector. Quantities are computed recursively IfrAbs3D:IfrAbs3D: all cluster types implement the same abstract interface

5 Luca Lista Cluster Class Diagram

6 Luca Lista Access to cluster information The access to cluster information is done using a visitor pattern IfrClusterVisitorEach functionality of the cluster classes is implemented in a separate subclass of IfrClusterVisitor base (templated) class for all cluster types –center of gravity, number of interaction lengths, number of strips/hits, first, last layer hit,, etc. Adding new functionality does not require any change to the class interfaces –a new visitor subclass has to be implemented Cache mechanism provided using a proxy pattern –cache is invalidated if a cluster changes Visitors instances are organized in an hash table to be fetched by a string key

7 Luca Lista Example of C++ Client Code IfrAbs3D* ifr; // get a cluster from somewhere // compute number of interaction lengths in the iron double l = ifr->accept( ifrVstDouble(“interactionLengths”) ); // compute center of gravity HepPoint c = ifr->accept( ifrVstPoint(“centerOfgravity”) ); // has hits in the barrel? bool barrel = ifr->accept(ifrVstHasBool(“hasBarrel”) ); // get number of hits in each layer int n[19]; for (int layer = 1; layer <= 19; layer++) n[layer-1] = ifr->accept( ifrVstInt(“hitsInLayer”, layer) );

8 Luca Lista Cluster Visitor Class Diagram Ifr3DCluster accept (IfrClusterVisitor & v) : T Ifr2DCluster accept (IfrClusterVisitor & v) : T IfrAbs3D accept (IfrClusterVisitor &) : T Ifr3DComposite accept (IfrClusterVisitor & v) : T T T IfrClusterVisitor operate (const Ifr3DCluster*) : T operate (const IfrInner3DCluster*) : T operate (const Ifr3DComposite*) : T operate (const Ifr2DCluster*) : T IfrInner3DCluster accept (IfrClusterVisitor & v) : T { { return v.operate( this ); } } 1..n IfrVstCenterOfGravity operate (const Ifr3DCluster*) : Hep3Vector operate (const IfrInner3DCluster*) : Hep3Vector operate (const Ifr3DComposite*) : Hep3Vector operate (const Ifr2DCluster*) : Hep3Vector IfrClusterVisitor{Hep3Vector} 2 2

9 Luca Lista Package Organization and Dependencies Abstract classes Concrete implementations

10 Luca Lista The IFR detector model IfrBarrelSector IfrPlanarSector IfrBarrelView IfrView IfrBwdCapSector IfrCylindricalSector IfrDetLeaf IfrEndCapView IfrFecIterator IfrFwdCapSector IfrInnerSector IfrInnerView IfrLayer IfrLayerIterator IfrSectorIterator IfrViewIterator -_components 1..* 1 IfrDetComposite 1 #_parent 0..1 -_component 0..11 1 IfrDetIterator 1 0..1 -_iterator 0..1 IfrSectorIfrFecIfrDetector IfrDetComponent 1 0..1 1 1..* 1

11 Luca Lista Cluster Reconstruction Clustering algorithms are implemented as modules of the B A B AR Framework Charged clustering –tracks are extrapolated in the non uniform B field –hits closer distant less than a given cut to the expect track intersections with the RPC are clustered together IfrClusterizer –a specific object ( IfrClusterizer ) returns the appropriate cluster object from a list of hits, independently on the algorithm Neutral clustering –hits unassociated to charged tracks undergo an IFR-alone clustering algorithm based on the hit distances in measured projection (“blob”) All clustering modules have a common steering part (iterating over sectors, etc.) that is abstracted in a strategy pattern

12 Luca Lista Evolution of Cluster Reconstruction The current IFR-alone “blob” clustering algorithm was used for charged clustering –the track extrapolation tools (“Swimmer”) were not available at the beginning The migration to the new clustering algorithm required no change to the cluster classes –no client code change was induced –the design and implementation of the new clustering algorithm took much less time than scheduled!

13 Luca Lista Particle Identification IfrPidInfoThe IFR delivers to external clients a PID summary object IfrPidInfo AbsPidInfo –inherits from a common B A B AR base class ( AbsPidInfo ) –implements the interface to handle significance levels and likelihood for different particle hypotheses PID likelihoods are extracted on the basis of discriminating variables that are computed using the visitors Calibration information are stored persistently –Implemented using Rogue Wave Tools.h++ –Objectivity under development –A flexible persistence design permits to change easily technology  see poster session...

14 Luca Lista Experience with software development Inflexible design was spotted when problems repeatedly occurred in the same code areas introducing changes Applying a more flexible design has usually improved the software management –more effective development –problems isolation A concrete example: computation of number of interaction lengths: –Abstract base class for cluster curve approximation –Path length in the detector model computation has been tested using a straight line implementation of the curve approximation –Polynomial approximation from a fit in each view was implemented separately –The integration of the two pieces has been immediately successful

15 Luca Lista Conclusions Object Oriented technology and Design Patterns have been applied to the IFR reconstruction software This showed benefits in: –Improving code flexibility and robustness –More effective software development –Reducing dependencies and decreasing the number of changes induced during the software evolution


Download ppt "Luca Lista Object Oriented Reconstruction Software for the IFR Detector of B A B AR Experiment Luca Lista INFN, Sezione di Napoli for the BaBar Computing."

Similar presentations


Ads by Google