#ifndef ELESTRUCT_HH #define ELESTRUCT_HH //Blocks: electron const Int_t MAXELE=50; struct myelectron_t { // Long description of variables added // Stephen Levy // September 26, 2003 // // Order of the variables listed below may not seem entirely logical. // This cannot be changed currently without changing code in a few // places due to the way the variables are added to the root-tuple. // This is not optimal and should be fixed soon. // Notes: // In descriptions below, best matching CES strip or wire means // that which is closest to CdfEmObject.maxPtTrack() if the track // exists. Otherwise, it means highest energy cluster (strip or wire). // // Current z0 of CdfEmObject (as needed below to calculate many // variables) comes from z0 of CdfEmObject.maxPtTrack() if it // exists and is 0 otherwise. The maxPtTrack() of a CdfEmObject // is the largest pt CdfTrack that intercepts the EmCluster seed tower. Int_t nele; // Number of CdfEmObjects in event Int_t clustersize[MAXELE]; //[nele] // Number of towers in matching EmCluster Int_t ntrks[MAXELE]; //[nele] // Number of CdfTracks associated with CdfEmObject Int_t detector[MAXELE]; //[nele] // Returns detector region // CEM = 0 // PEM = 1 Int_t idword[MAXELE]; //[nele] // Integer where each bit represents whether a given "standard" electron id cut was passed (1) or failed (0) // The definition of "standard" is time-dependent. // I don't recommend using this variable anymore until we update the // definitions of the cuts. Also, we should have the capability of // determining the value of these cuts with the variables in this // block at the analysis stage (i.e., it is unnecessary to fill this variable). // However, I don't like the way we are currently storing the PJW // leakage correction. Int_t isoword[MAXELE]; //[nele] // No longer filled; set to -9 always Int_t conword[MAXELE]; //[nele] // From http://cdfkits.fnal.gov/CdfCode/source/include/ElectronUser/ConversionFinder.hh : //====================================================================== // Electron conversion id //----------------------- // return value = 1 (conversion electron) // 0 (not conversion) // -1 (error : no defTrack found or no track matched to electron) // -2 (trident) // // This uses the Top Group's conversion finding algorithm for electrons // found in ElectronUser. We currently require Delta(cot theta) < 0.04 // and DeltaXY < 0.2 cm (See CDF Note 6250) Int_t fidword[MAXELE]; //[nele] // Integer where each bit represents whether some fiducial requirement was passed (1) or failed (0). // Bits are numbered 76543210 // // For CEM: // bit 0 : | x CES position | < 21 cm // bit 1 : | z CES position | > 9 cm // bit 2 : | z CES position | < 217 cm // bit 3 : | z CES position | > 14 cm // bit 4 : if (0.82 < detector eta < 1.1 && Pi/2 < phi < 5 Pi/12) bit=1, else bit=0 // // For PEM: // bit 16 : | pchideteta | > 1.2 // bit 17 : | pchideteta | < 2.11 See below for definition of pchideteta // bit 18 : | pchideteta | < 2.5 Int_t trkindex[MAXELE]; //[nele] // Index to entry in track block that matches CdfEmObject.maxPtTrack(). // Match means the tracks have the same CdfTrack->id() or the id of // the lowest track in the parent-child track link list is the same. Float_t px[MAXELE]; //[nele] Float_t py[MAXELE]; //[nele] Float_t pz[MAXELE]; //[nele] Float_t e[MAXELE]; //[nele] // electron 4-momentum (p4) for CdfEmObject // ---------------------------------------- // // Essentially, the p4 energy is determined by the energy deposited // in a seed em cluster and a daughter tower. The mag of the // three-momentum is the same as the energy and the direction is // given by the unit vector pointing from the z0 of the highest pt // track matched to the cluster to the shower position in the CES. // CEM tower corrections based on the x,z CES position are applied // as described in more detail below. // // Specifically, p4 components come from emobj_alg::CEMFourMomentum::TwoTower(CdfEmObject, false ). // If CdfEmObject.maxPtTrack() exists, then p4 = p4 / correction // where correction is set by // CemCorrAlg::GetCemCorr(CdfEmObject,"USETRACK", correction) and // explained in more detail below. Correction may not be valid in // which case p4 is returned uncorrected. // // Uncorrected p4 // ---------------- // p4 found by emobj_alg::CEMFourMomentum::TwoTower fcn // let p4 = CdfEmObject.fourMomentum( "SHWRMAX" ) // fcn returns: p4 * (energy of seed CEM tower + energy of daughter tower) / p4.energy() // where // energy of seed CEM tower := CdfEmObject.matchingEmCluster()->seed().emE() // energy of daughter tower := PhysicsTower->emEnergy(); // and the daughter tower is determined in a complicated way by the z position of the shower in the CES // // CdfEmObject::fourMomentum("SHWRMAX") // Sets energy to matchingEmCluster()->emEnergy() // Get z position at cal with largestEnergyCesCluster(CesCluster::STRIP)->global_position() // Get phi0 position at cal with matchingEmCluster()->emPhi() // cot(theta) = z position at cal - matchingEmCluster()->vertexZ() / radius // et = matchingEmCluster()->emEnergy() * sin(theta) // px(py) = et * cos(sin)phi0 // pz = et * cot(theta) // // For cot(theta) calculation, vertexZ() = current z0 = z0 of maxPtTrack() if it exists // // Correction // ---------- // Somewhat complicated code to find "best" x,z CES shower positions for central electrons. // Correction depends only on these x,z CES positions. // Correction takes into account: // 1. CEM mapping corrections, // 2. CEM tower-to-tower corrections // 3. Global E energy scale correction // // See Electron/src/CemCorrAlg::cemfix(double xlocal, double zlocal, double& corrfac) // Float_t et[MAXELE]; //[nele] // Total (transverse) energy (EM Et + HAD Et) // CdfEmObject->getEmCluster()->totalEt() // z0 of maxPtTrack() is used Float_t etcorr[MAXELE]; //[nele] // Corrected Et // Gets electron p4 as defined above and returns Et if // CdfEmObject.maxPtTrack() exists. // Otherwise, if just a cluster, takes Et from // CdfEmObject->getEmCluster()->emEt() and applies // CemCorrAlg::GetCemCorr( em_object, "USETRACK", corr) described // above for central electrons (no correction for plug). Float_t eveta[MAXELE]; //[nele] // Event eta // Return pseudoRapidity() of p4 defined above if CdfEmObject.maxPtTrack() exists. // Otherwise, return EmCluster->emEtaEvent() // emEtaEvent() := EmCluster pseudorapidity calculated using current Z vertex (z0 of maxPtTrack()) Float_t phi[MAXELE]; //[nele] // Returns phi() of p4 defined above if CdfEmObject.maxPtTrack() exists. // Otherwise returns phi of best matching CES wire. // Otherwise returns phi of CdfEmObject->matchingEmCluster() // Phi is always returned in the range [0,2Pi] Float_t ettwotow[MAXELE]; //[nele] // No longer filled; set to -99 always Float_t pttrk[MAXELE]; //[nele] // Returns pt of CdfEmObject.maxPtTrack() or -9999 if it does not exist. Float_t deteta[MAXELE]; //[nele] // Detector eta // If central electron: use eta of best matching CES strip & wire. // If plug electron: use eta of PES cluster closest to PEM centroid // If above fails: use EMCluster->emEtaDetector() (uses z=0) Float_t ep[MAXELE]; //[nele] // E/p // If CdfEmObject.maxPtTrack() exists: // E = CdfEmObject.getEmCluster()->emEnergy() // p = CdfEmObject.maxPtTrack()->momentum().mag() // else return -9999 // Why aren't we using the energy that comes from the CEMFourMomentum::TwoTower calculation? // (i.e., this energy is EM energy from EmCluster, not from seed cluster + daughter tower) Float_t charge[MAXELE]; //[nele] // Charge from CdfEmObject.maxPtTrack() or -9999 if it does not exist Float_t chi2mean[MAXELE]; //[nele] // Average of chi2strip and chi2wire. // = 0.5 * (chi2strip + chi2mean) // probably too complex to try this after the ntuple is made Float_t chi2strip[MAXELE]; //[nele] // Get chi2 of best CES strip // then scale chi2 by 0.1792 * pow( 2.11, log(CdfEmObject.getEmCluster()->emEnergy()) ) // Code does not explain functional form or coeff of scaling. Float_t chi2three[MAXELE]; //[nele] // CdfEmObject.matchingEmCluster()->pem3x3Chisq(); Float_t chi2wire[MAXELE]; //[nele] // Get chi2 of best CES wire // then scale chi2 by 0.1792 * pow( 2.11, log(CdfEmObject.getEmCluster()->emEnergy()) ) // Code does not explain functional form or coeff of scaling. Float_t eme[MAXELE]; //[nele] // Raw energy of cluster in EM calorimeter // CdfEmObject.getEmCluster()->emEnergy() Float_t emet[MAXELE]; //[nele] // EM Calorimeter Et // CdfEmObject.getEmCluster()->emEt() // Calculated using current Z Vertex (z0 of maxPtTrack()) // For energy isolation variables below (emiso4, emiso7, hadiso4, // hadiso7, iso4, iso7), the energy returned does not include the energy // deposited by the CdfEmObject Float_t emiso4[MAXELE]; //[nele] // EM isolation in Cone of 0.4 // CdfEmObject.getEmCluster()->emIsolationEt4() // Calculated using current Z Vertex (z0 of maxPtTrack()) Float_t emiso7[MAXELE]; //[nele] // EM isolation in Cone of 0.7 // CdfEmObject.getEmCluster()->emIsolationEt7() // Calculated using current Z Vertex (z0 of maxPtTrack()) Float_t hade[MAXELE]; //[nele] // Returns raw energy of cluster in Had calorimeter // EmCluster->hadEnergy() Float_t hadet[MAXELE]; //[nele] // Returns transverse Had energy // EmCluster->hadEt() // Calculated using current Z Vertex (z0 of maxPtTrack()) Float_t hadiso4[MAXELE]; //[nele] // Returns Had isolation energy in cone of 0.4 // EmCluster->hadIsolationEt4() // Calculated using current Z Vertex (z0 of maxPtTrack()) Float_t hadiso7[MAXELE]; //[nele] // Returns Had isolation energy in cone of 0.7 // EmCluster->hadIsolationEt7() // Calculated using current Z Vertex (z0 of maxPtTrack()) Float_t hadem[MAXELE]; //[nele] // Returns (total Had energy / total EM energy) // EmCluster->hadEm() Float_t iso4[MAXELE]; //[nele] // Returns total isolation Et (had + em) in cone of 0.4 // EmCluster->totalIsolationEt4() // By definition = emiso4 + hadiso4 Float_t iso7[MAXELE]; //[nele] // Returns total isolation Et (had + em) in cone of 0.7 // EmCluster->totalIsolationEt7() // By definition = emiso7 + hadiso7 Float_t time[MAXELE]; //[nele] // returns CdfEmObject time, averaged over all firing TDCs // -9999 if no TDC fired for the cluster Float_t chatime[MAXELE]; //[nele] // returns CdfEmObject time, averaged over all firing TDCs in CHA // -9999 if no TDC fired in CHA Float_t whatime[MAXELE]; //[nele] // returns CdfEmObject time, averaged over all firing TDCs in WHA // -9999 if no TDC fired in WHA Float_t phatime[MAXELE]; //[nele] // returns CdfEmObject time, averaged over all firing TDCs in PHA // -9999 if no TDC fired in PHA Float_t lshr[MAXELE]; //[nele] // Lshr is only valid in the CEM when the number of towers // associated with the cluster is 2 or 3. The code to calculate // lshr is very complex. Essentially, lshr indicates how well the // energy sharing in the 2 or 3 tower EmCluster matches that // expected for a showering electron. // The formula to calculate lshr (given in CDF Note 2389 Eq(1) is: // // lshr = 0.14 * Sum_{k} * \frac{ M_k - P_k }{ \sqrt{ 0.0916*EM + (\delta P_k)^{2} } } // // where the sum is over towers adjacent to seed tower, M_k // is measured energy in the adjacent tower, P_k is expected // energy in the adjacent tower as estimated from 1985 beam // estimates EM is the electromagnetic energy in the cluster, // and \delta P_k is an estimate of the error in P_k. Float_t lshr2[MAXELE]; //[nele] // deprecated Float_t tiso[MAXELE]; //[nele] // Track isolation // Returns the pt sum of tracks in a cone of 0.4 around the // electron track that are not the electron track and have z0 within // 5 cm of the electron track. // Note: we use the function trkTrackIsolation in // // HighLevelObjects/src/Tracking/TrackingVariables2.cc // // to calculate this and not the function eleTiso in // // HighLevelObjects/src/Electron/ElectronVariables.cc // // that purports to calculate the same quantity. We may want to // validate that these functions do the same thing and then remove // one of them (I vote to remove ElectronVariables::eleTiso). Float_t xces[MAXELE]; //[nele] // Returns position of best matching CES wire cluster // If wire cluster is null, returns -8888.0 Float_t delx[MAXELE]; //[nele] // Returns distance between the best matching CES wire cluster and // the CdfEmObject.maxPtTrack() extrapolated to the CES // If the CdfEmObject does not have a track, returns -9999.0 Float_t zces[MAXELE]; //[nele] // Returns position of best matching CES wire strip // If wire cluster is null, returns -8888.0 Float_t delz[MAXELE]; //[nele] // Returns distance between the best matching CES strip cluster and // the CdfEmObject.maxPtTrack() extrapolated to the CES // If the CdfEmObject does not have a track, returns -9999.0 Float_t ztrk[MAXELE]; //[nele] // Returns z0 of CdfEmObject.maxPtTrack() Float_t ztrkces[MAXELE]; //[nele] // Return z coord of Hep3Vector with local coordinates of highest Pt // track extrapolated to the plane of shower max in calorimeter to // which it has been associated. // Local coordinate definitions: // CEM: z axis in plane of CES, parallel to global z axis, // z=0 at global z=0; y axis perp. to plane of CES, y=0 at // nominal beam axis; x axis in plane of CES, perp. to z axis // to form righthanded coord. system. x=0 at CES axial center. // PEM: local and global coordinate systems identical Float_t zvtx[MAXELE]; //[nele] // Returns EmCluster->vertexZ() // This is the z0 of maxPtTrack() if it exists, 0 otherwise Float_t likelihood[MAXELE]; //[nele] // Likelihood that CdfEmObject is an electron. // Separate likelihood for CEM (CDF-5934) and PEM (CDF-5902). // New Likelihood from Steve L. as of Oct. 10, 2003. Float_t pesx[MAXELE]; //[nele] //measured position of x coordinate of plug 2d cluster; Float_t pesy[MAXELE]; //[nele] // measured position of y coordinate of plug 2d cluster; // The following three (pchiX) variables refer to a PEMChiSquare // object. The PEMChiSquare finds the (eta,phi) centroid of an // emCluster in the PPR+PEM by fitting a grid of towers centered on // the cluster seed to an EM shower profile. Float_t pchideteta[MAXELE]; //[nele] // eta position of chi2 fit for pes shower Float_t pchiphi[MAXELE]; //[nele] // phi position of chi2 fit for pes shower Float_t npemfittow[MAXELE]; //[nele] // number of towers used in pem chi2 fit // The following two pes5by9X variables come from the // CdfEmObject::bestMatchingPes2dCluster // This is the largest energy cluster whose separation from the // PEM location from 3x3 chi-squared fitting is within some // specified distance. Float_t pes5by9U[MAXELE]; //[nele] // For the default 9-strip fixed width clustering, this returns the // ratio [sum of energy in central 5 strips] divided by [total // energy in cluster]. The intended use of the variable is for // electron i.d. Float_t pes5by9V[MAXELE]; //[nele] // For the default 9-strip fixed width clustering, this returns the // ratio [sum of energy in central 5 strips] divided by [total // energy in cluster]. The intended use of the variable is for // electron i.d. Float_t convrad[MAXELE]; //[nele] // Currently deprecated. May return in the future... // Old Description: // Distance to conversion vertex // Conversions are found using SoftElectronAlgs/ConversionFinder // Algorithm is based on XY separation and delta(cot(theta)) // conversions must have xy sep < 0.2 cm and delta(cot(theta)) < 0.1 // and a distance to conversion vertex > 0.1 cm. Int_t phoindex[MAXELE]; //[nele] // Index to entry for this CdfEmObject in photon block. By defintion // same as index in the electron block (i.e., same loop over // CdfEmObjects is made in both blocks). Int_t jetindex[MAXELE]; //[nele] // Index to entry in jet block that has minimum deltaR between // electron and jet where, // deltaR = sqrt( deltaPhi^2 + deltaDetectorEta^2 ) // deltaR must be in ragne (0,0.7) or index is set to -1 Int_t fidele[MAXELE]; //[nele] // Fiducial routine for electrons. // Calculated using CES strip and wire cluster seeded by max pt // track or if no track largest energy CES consistent with seed tower. // // FidEle_Status Integer Value Condition // ============= ============= ========= // ERROR -1 error (null strip/wire cluster) // NONFIDUCIAL 0 not fiducial in central or plug // FIDUCIAL_CEM 1 fiducial in central or plug // FIDUCIAL_CEMTWR_9 2 fiducial, but in CEM Tower 9 // FIDUCIAL_CHIMNEYTWR_7 3 fiducial, but in Chimney wedge tower 7 // FIDUCIAL_CEM_TRACK 4 fiducial in CEM using max pt track extrapolated to plane of CES // FIDUCIAL_PEM 5 fiducial in PEM using PES // FIDUCIAL_PEM_TRACK 6 fiducial in PEM using max pt track extrapolated to plane of PES // NOT YET IMPLEMENTED Float_t ztrkerr[MAXELE]; //[nele] // Returns z0 error of CdfEmObject.maxPtTrack() Float_t zcentroid[MAXELE]; //[nele] // Returns cluster centroid Z-coordinate in global CDF coordinates. // EmCluster->zCentroid() Float_t likelihood_old[MAXELE]; //[nele] // Bruce K.'s likelihood. Before Oct. 10, 2003 Float_t isocor[MAXELE]; //[nele] // I'm currently adding this variable to get PJW leakage correction. // This correction is documented in CDF Note 4170. // Correction coded in Electron/src/IsoCorrAlg.cc // Idea is to correct for known EM calorimeter leakage (based on // test beam data from electrons). Uses wire cluster (x CES pos.) // closest to maxPtTrack() or highest energy cluster if no track exists. Float_t pemdeltar[MAXELE]; //[nele] // Radial distance between highest energy PEM cluster and chi2 fitted position Int_t istight[MAXELE]; //[nele] Float_t ppre[MAXELE]; //[nele] // PPR energy as obtained trhough emobj_alg::PPREnergy }; #endif