Or you write your own framework-executable. In this case
you may find the following following
chapter interesting.
(Note: To compare reco and L3 information,
in almost all cases you will have to make a framework
executable. While including MC information in the trigsim ntuple
is fairly straightforward, including reco information is not and
there are no plans to change this.)
In our case the chunks you need are the classes L3Chunk for the physics and L3DebugChunk for the debug info, both belonging to the package l3fchunk
The idea of both, the debug and the physics chunk, is generally that they contain a std::map which assignes a keyword to an instance of the class that contains the data for a certain tool. To make things easy, the keyword is the toolname which you can find in your toollist (or the trigger list), e.g. "MUO_LOCAL".
In the case of L3DebugChunk the mentioned class is derived from L3DebugInfo (package l3utilites), in the case of L3Chunk it's derived from L3PhysicsResults (package l3fresults). In order to get these maps from the chunk you can use the methods L3DebugChunk::getDebugInfo() or L3Chunk::getPhysToolMap() resp.
How to practically realize the access to the variables is probably explained best by examples:
(The relevant methods and classes are highlighted. For a complete list of all accessors please have a look at the source code of the respective classes
const Muon::SegmentCollection& muoseg = localinfo->getSegmentCollection(); // vector of segments -- package muo_segment for(Muon::SegmentCollection::const_iterator seg=muoseg.begin(); seg!=muoseg.end(); seg++){ cout << "Phi = " << seg->phi() << endl; // Example: retrieve phi angle }
const std::vector<Muon::Track>& muotrack = localinfo->getLocalTrackVector(); // vector of tracks -- package muo_trackreco for(std::vector<Muon::Track>::const_iterator track=muotrack.begin(); track!=muotrack.end(); track++){ cout << "Theta = " << track->getTheta() << endl; // Example: retrieve theta angle }
const std::vector<L3MuoTrack> l3muotrackvec = cminfo->getL3MuoTrackVector(); // vector of L3 muon tracks -- package l3fmuo_local for (std::vector<L3MuoTrack>::const_iterator l3track=l3muotrackvec.begin(); l3track!=l3muotrackvec.end(); l3track++) { L3MuoCentralMatchData matchdata = (*l3track).getCentralMatchData(); // This class contains the relevant information about the central match cout << "Central pT = " << matchdata.pt_central << endl; // no accessors here - just public class members. }
const Muon::PDTHitCollection &pdtcollection = unpinfo->getMuoHitCollection().getPDTHits(); // vector of PDT hits -- package muo_hit const Muon::MDTHitCollection &mdtcollection = unpinfo->getMuoHitCollection().getMDTHits(); // vector of MDT hits -- package muo_hit const Muon::MSCHitCollection &msccollection = unpinfo->getMuoHitCollection().getMSCHits(); // vector of MSC hits -- package muo_hit // Loop over the MSC hits (for MDT and PDT alalogous) for (Muon::MSCHitCollection::const_iterator it_scint=msccollection.begin(); it_scint != msccollection.end(); it_scint++){ // ---- First get the detector information --- Muon::MuoIndex index = it_scint->getMuoIndex(); // MuoIndex: Collection of deector information cout << "Phi = " << index.phi() << endl; // Example: retrieve phi angle // ---- Now get the information about geometrical hit positions --- Muon::MSCGeometryHit pdthitadaptor((Muon::MSCHit*)it_scint); const SpacePoint& point = mschitadaptor.getGlobalPosition(); cout << "x = " << point.x() << " y = " << point.y() << " z = " << point.z() << endl; }
To select offline/online chunks (if the default option is not what you want) change trigsim_analyze/rcp/runTrigSimAnalyze_l3only.rcp:
RCP l3fana =<l3fanalyze L3Analyze_auto_online>to
RCP l3fana =<l3fanalyze L3Analyze_auto_offline>(or vice versa).
<TOOLNAME>_[p/d]_[on/off]_<VARIABLENAME>,where
L3<3-LETTER-IDENTIFIER>[D/PR],where PR or D stands for "physics" or "debug" chunk resp. For the 3-letter identifier see documentation.
<ABBREV-TOOLNAME>_<NUMBER>_[on/off]_<VARIABLENAME>,where ABBREV-TOOLNAME is an abbreviation of the tool's class name (i.e "L3MuoLocal"). The number is a consecutive 2-digit number. (For details see documentation.)
| Type | Name | Description | |
|---|---|---|---|
| Int_t | NMDT | number of MDT (mini drift tubes) hits | |
| Float_t | MDTbar | barrel number (muon index: see note at the end of the page), 0 for all MDT | |
| Float_t | MDTddist | drift distance | |
| Float_t | MDTdtime | drift time | |
| Float_t | MDTeta | muon index eta | |
| Float_t | MDThitx | global x position of MDT hit | |
| Float_t | MDThity | global y position of MDT hit, calculated as above | |
| Float_t | MDThitz | global z position of MDT hit, calculated as above | |
| Float_t | MDTlayer | muon index layer (0,1,2) | |
| Float_t | MDToct | muon index octant (0->7) | |
| Float_t | MDTphi | muon index phi, always 0 for MDT | |
| Float_t | MDTplane | muon index plane (0,1,2,3) | |
| Float_t | MDTreg | muon index region, 1 (north) or 2 (south) for MDT | |
| Float_t | MDTtube | muon index tube, 0 to 7 | |
| Float_t | MDTtype | muon index type, 0 for MDT | |
| Int_t | NMSC | number of scintillator hits (forward and central) | |
| Float_t | MSCbar | muon index barrel, 0,1,2,3,4 | |
| Float_t | MSCddist | Drift distance. There is no drift distance in a scintillator, so this variable is set to 0. | |
| Float_t | MSCdtime | drift time | |
| Float_t | MSCeta | muon index Eta of the scintillator hit | |
| Float_t | MSChitx | x-position of the scintillator hit | |
| Float_t | MSChity | y-position of the scintillator hit | |
| Float_t | MSChitz | z-position of the scintillator hit | |
| Float_t | MSClayer | muon index Layer (0..3) of the scintillator hit | |
| Float_t | MSCoct | muon index Octant (0..7) of the scintillator hit | |
| Float_t | MSCphi | muon index Phi of the scintillator hit | |
| Float_t | MSCplane | muon index Plane (0..3) of the scintillator hit | |
| Float_t | MSCreg | muon index Region (0..2) of the scintillator hit | |
| Float_t | MSCtube | muon index Tube number of the scintillator hit | |
| Float_t | MSCtype | ... | |
| Int_t | NPDT | number of PDT (proportional drift tubes) hits | |
| Float_t | PDTbar | muon index::barrel number (in z direction) | |
| Float_t | PDTddist | drift distance | |
| Float_t | PDTdtime | drift time | |
| Float_t | PDTeta | muon index::eta | |
| Float_t | PDThitx | global x of PDT hit | |
| Float_t | PDThity | global y of PDT hit | |
| Float_t | PDThitz | global z of PDT hits | |
| Float_t | PDTlayer | muon index layer | |
| Float_t | PDToct | muon index octant | |
| Float_t | PDTphi | muon index phi | |
| Float_t | PDTplane | muon index plane (0,1,2,3) | |
| Float_t | PDTreg | muon index region: is always 0 as PDTs are only in central region | |
| Float_t | PDTtube | muon index tube, is always 0 for PDT (needs some hardware comment here, ask T. Diehl ?) | |
| Float_t | PDTtype | muon index type (is 0 for drift tube) |
| Type | Name | Description |
|---|---|---|
| Int_t | NMDTHIT | number of MDT hits (same as in unpacker) |
| Float_t | MDTHIT_hitx | Global x position of MDT hit. |
| Float_t | MDTHIT_hity | Global y position of MDT hit. |
| Float_t | MDTHIT_hitz | Global z position of MDT hit. |
| Int_t | NMSCHIT | number of scintillator hits (same as in unpacker) |
| Float_t | MSCHIT_hitx | Global x of scintillator hit. |
| Float_t | MSCHIT_hity | Global y of scintillator hit. |
| Float_t | MSCHIT_hitz | Global z of scintillator hit. |
| Int_t | NPDTHIT | number of PDT hits (same as in unpacker) |
| Float_t | PDTHIT_hitx | Global x position of PDT hit. |
| Float_t | PDTHIT_hity | Global y position of PDT hit. |
| Float_t | PDTHIT_hitz | Global z position of PDT hit. |
| Int_t | NSEG | number of segments (all segments, not just the ones used to make tracks) |
| Float_t | SEGangled | drift angle |
| Float_t | SEGchi2 | chi2 of segment fit |
| Float_t | SEGerangled | error on drift angle |
| Float_t | SEGerphi | error on detector phi |
| Float_t | SEGerx | Error of x position of segment |
| Float_t | SEGery | Error of y position of segment |
| Float_t | SEGerz | Error of z position of segment |
| Float_t | SEGphi | detector phi of segment |
| Float_t | SEGx | Global x position of segment |
| Float_t | SEGy | as above |
| Float_t | SEGz | as above |
| Int_t | NTRK | number of tracks |
| Float_t | TRKaxialres | not filled, set to 999 |
| Float_t | TRKbangle | bending angle in the toroid. (Not filled, set to 999) |
| Float_t | TRKcharge | Charge of track: +1, -1 obviously. |
| Float_t | TRKchi2 | chi2 of fit from A segment to BC segment.(-1 for A stubs or if fit fails.) |
| Float_t | TRKdriftres | not filled, set to 999 |
| Float_t | TRKeloss | Energy loss in calorimeter (from Run I by eta, phi, not pt, muon is assumed to behave as a MIP) |
| Float_t | TRKitnber | number of iterations of track fit (used to derive sensible maximum number of iterations) |
| Float_t | TRKms1 | multiple scattering angle (Not filled, set to 999) |
| Float_t | TRKms2 | as above |
| Float_t | TRKnhits_a | number of (wire+scint) hits in A-Layer (0->8 for PDT only, more for PDT and MDT combined) |
| Float_t | TRKnhits_bc | number of (wire+scint.) hits in BC-Layer (Hits in B- and C-layer are not counted separately) |
| Float_t | TRKnschits_a | Number of scintillator hits of a track in the A-layer. |
| Float_t | TRKnschits_bc | Number of scintillator hits of a track in the BC-layer. |
| Float_t | TRKnwhits_a | Number of wire hits of a track on the A-layer |
| Float_t | TRKnwhits_bc | Number of wire hits of a track on the BC-layer |
| Float_t | TRKoctant | Octant of the track |
| Float_t | TRKpta | pt at the A layer (not corrected) |
| Float_t | TRKptrk | track momentum corrected for energy loss in the calorimeter |
| Float_t | TRKpttrack | transverse momentum of the track |
| Float_t | TRKpxa | x-component of the track momentum in the A-layer (i.e. before the toroid) |
| Float_t | TRKpxb | x-component of the track momentum in the BC-layer |
| Float_t | TRKpya | y-component of the track momentum in the A-layer |
| Float_t | TRKpyb | y-component of the track momentum in the BC-layer |
| Float_t | TRKpza | z-component of the track momentum in the A-layer |
| Float_t | TRKpzb | z-component of the track momentum in the BC-layer |
| Float_t | TRKquality | |
| Float_t | TRKregion | -1 = South, 0 = Central, 1 = North |
| Float_t | TRKtrk_eta | eta at A-layer |
| Float_t | TRKtrk_phi | phi at A-layer |
| Float_t | TRKxa | x-coordinate of track at intersection with A-layer (= A-layer segment position) |
| Float_t | TRKxb | x-coordinate of track at intersection with BC-layer (= BC-layer segment position) |
| Float_t | TRKya | y-coordinate of track at intersection with A-layer |
| Float_t | TRKyb | y-coordinate of track at intersection with BC-layer |
| Float_t | TRKza | z-coordinate of track at intersection with A-layer |
| Float_t | TRKzb | z-coordinate of track at intersection with BC-layer |
| Type | Name | Description |
|---|---|---|
| Int_t | n | Number of entries |
| Float_t | ET | Transverse energy (or momentum) |
| Float_t | Eta | (Detector) eta |
| Float_t | kineT | |
| Float_t | kineX | |
| Float_t | kineY | |
| Float_t | kineZ | |
| Float_t | vtxX | x-coordinate of the vertex |
| Float_t | vtxY | y-coordinate of the vertex |
| Float_t | vtxZ | z-coordinate of the vertex |
The second group of variables is specific to the muon physics results.
| Type | Name | Description |
|---|---|---|
| Int_t | NMUON | Number of entries |
| Float_t | MUONregion | Region of the muon track (-1=South, 0=Central, 1=North) |
| Float_t | MUONoctant | Octant of the muon track |
| Float_t | MUONeta | Eta of the local muon track |
| Float_t | MUONphi | Phi of the local muon track |
| Float_t | MUONxA | x-coordinate of the segment in the A-layer |
| Float_t | MUONyA | y-coordinate of the segment in the A-layer |
| Float_t | MUONzA | z-coordinate of the segment in the A-layer |
| Float_t | MUONxB | x-coordinate of the segment in the BC-layer |
| Float_t | MUONyB | y-coordinate of the segment in the BC-layer |
| Float_t | MUONzB | z-coordinate of the segment in the BC-layer |
| Float_t | MUONquality | See note below |
| Float_t | MUONetrack | Energy of the muon track in the calorimeter (not yet used) |
| Float_t | MUONhfrac | Hadronic fraction of the muon track in the calorimeter (not yet used) |
| Float_t | MUONimpactXY | Impact parameter of the central track |
| Float_t | MUONsignifImpactXY | Significance of the impact parameter |
| Float_t | MUONcmEta | Eta of the matching central track |
| Float_t | MUONcmPhi | Phi of the matching central track |
| Float_t | MUONcmZ | Z-position of the matching central track |
| Float_t | MUONcmPt | Transverse momentum of the matching central track |
| Float_t | MUONchisq | Chi^2 of the central match |
float pT_local =
abs((*iter)->getMomentA().perp()/(*iter)->getMomentA().mag(),*(*iter)->getMomentum());
getMomentA() returns the momentum vector in the A-layer which is not corrected for energy-loss in the calorimeter.to reproduce the equivalent number from the l3fanalyze ntuple use: TRKpxb, TRKpyb and TRKpzb
| region: | 0 = central, 1 = north, 2 = south |
| type: | 0 = wire chamber, 1 = scintillator |
| layer: | 0 = A-layer, 1 = B-layer, 2 = C-layer |
| octant: | 0-7, 0 starts at x-axis towards y-axis |
| barrel: | (central only) A: 1, 2, 3; B/C: 0, 1, 2, 3, 4; B/C octants 5, 6: 0, 1, 3, 4 (These numbers are also encoded in the PDTs: PDT = ijk, where i = layer, j = barrel, k = octant) |
| plane: | scintillators: 0, Wires: increasing away from the origin Wire A-layer: 0, 1, 2, 3; Central A-layer, Octants 5 \ 6: 0, 1, 2 Wire B/C-layer: 0, 1, 2 |
| eta: | Central: increases in z, Forward: increases in r |
| phi: | Wire: 0, Scint: 0-9, increases in global phi. Note that the labeling in phi is not symmetric around the beam. |
| tube: | Scintillator with 2 PMT: 0-1, MDT: 0-7 |