CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Macros | Functions | Variables
Vx3DHLTAnalyzer.h File Reference
#include <memory>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include <TF3.h>
#include <iostream>
#include <fstream>
#include <vector>

Go to the source code of this file.

Classes

struct  VertexType
 
class  Vx3DHLTAnalyzer
 

Macros

#define DIM   3
 

Functions

double Gauss3DFunc (const double *par)
 

Variables

bool considerVxCovariance
 
unsigned int counterVx
 
double maxLongLength
 
double maxTransRadius
 
double pi
 
std::vector< VertexTypeVertices
 
double VxErrCorr
 
double xPos
 
double yPos
 
double zPos
 

Macro Definition Documentation

#define DIM   3

Function Documentation

double Gauss3DFunc ( const double *  par)

Definition at line 176 of file Vx3DHLTAnalyzer.cc.

References considerVxCovariance, counterVx, DIM, i, create_public_lumi_plots::log, maxLongLength, maxTransRadius, pi, mathSSE::sqrt(), Vertices, VxErrCorr, x, xPos, detailsBasic3DVector::y, yPos, detailsBasic3DVector::z, and zPos.

Referenced by Vx3DHLTAnalyzer::MyFit().

177 {
178  double K[DIM][DIM]; // Covariance Matrix
179  double M[DIM][DIM]; // K^-1
180  double det;
181  double sumlog = 0.;
182 
183 // par[0] = K(0,0) --> Var[X]
184 // par[1] = K(1,1) --> Var[Y]
185 // par[2] = K(2,2) --> Var[Z]
186 // par[3] = K(0,1) = K(1,0) --> Cov[X,Y]
187 // par[4] = K(1,2) = K(2,1) --> Cov[Y,Z] --> dy/dz
188 // par[5] = K(0,2) = K(2,0) --> Cov[X,Z] --> dx/dz
189 // par[6] = mean x
190 // par[7] = mean y
191 // par[8] = mean z
192 
193  counterVx = 0;
194  for (unsigned int i = 0; i < Vertices.size(); i++)
195  {
197  (std::fabs(Vertices[i].z-zPos) <= maxLongLength))
198  {
199  if (considerVxCovariance == true)
200  {
201  K[0][0] = std::fabs(par[0]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[0][0]);
202  K[1][1] = std::fabs(par[1]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[1][1]);
203  K[2][2] = std::fabs(par[2]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[2][2]);
204  K[0][1] = K[1][0] = par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][1];
205  K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[1][2];
206  K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][2];
207  }
208  else
209  {
210  K[0][0] = std::fabs(par[0]);
211  K[1][1] = std::fabs(par[1]);
212  K[2][2] = std::fabs(par[2]);
213  K[0][1] = K[1][0] = par[3];
214  K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
215  K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
216  }
217 
218  det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
219  K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
220  K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
221 
222  M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
223  M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
224  M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
225  M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
226  M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
227  M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
228 
229  sumlog += double(DIM)*std::log(2.*pi) + std::log(std::fabs(det)) +
230  (M[0][0]*(Vertices[i].x-par[6])*(Vertices[i].x-par[6]) +
231  M[1][1]*(Vertices[i].y-par[7])*(Vertices[i].y-par[7]) +
232  M[2][2]*(Vertices[i].z-par[8])*(Vertices[i].z-par[8]) +
233  2.*M[0][1]*(Vertices[i].x-par[6])*(Vertices[i].y-par[7]) +
234  2.*M[1][2]*(Vertices[i].y-par[7])*(Vertices[i].z-par[8]) +
235  2.*M[0][2]*(Vertices[i].x-par[6])*(Vertices[i].z-par[8]));
236 
237  counterVx++;
238  }
239  }
240 
241  return sumlog;
242 }
int i
Definition: DBlmapReader.cc:9
double maxLongLength
double zPos
float float float z
double maxTransRadius
bool considerVxCovariance
double xPos
T sqrt(T t)
Definition: SSEVec.h:48
double yPos
#define DIM
std::vector< VertexType > Vertices
unsigned int counterVx
double pi
double VxErrCorr
Definition: DDAxes.h:10

Variable Documentation

bool considerVxCovariance

Definition at line 63 of file Vx3DHLTAnalyzer.h.

Referenced by Vx3DHLTAnalyzer::beginJob(), and Gauss3DFunc().

unsigned int counterVx
double maxLongLength

Definition at line 66 of file Vx3DHLTAnalyzer.h.

Referenced by Gauss3DFunc(), and Vx3DHLTAnalyzer::MyFit().

double maxTransRadius

Definition at line 65 of file Vx3DHLTAnalyzer.h.

Referenced by Gauss3DFunc(), and Vx3DHLTAnalyzer::MyFit().

double pi

Definition at line 68 of file Vx3DHLTAnalyzer.h.

Referenced by Hector::addPartToHepMC(), evf::ExceptionGenerator::analyze(), ElectronMcSignalValidator::analyze(), HiBasicGenTest::analyze(), ElectronAnalyzer::analyze(), ElectronMcFakeValidator::analyze(), ElectronSeedAnalyzer::analyze(), SimplePhotonAnalyzer::analyze(), GsfElectronDataAnalyzer::analyze(), GsfElectronMCFakeAnalyzer::analyze(), DQMAnalyzer::analyze(), GsfElectronFakeAnalyzer::analyze(), GsfElectronMCAnalyzer::analyze(), RPCPhiEff::analyze(), ContainmentCorrectionAnalyzer::analyze(), cms::DiJetAnalyzer::analyze(), PhotonValidator::analyze(), BasicHepMCHeavyIonValidation::beginJob(), EwkDQM::beginJob(), HiggsDQM::beginJob(), Vx3DHLTAnalyzer::beginJob(), ExoticaDQM::beginJob(), HLTTauDQML1Plotter::beginRun(), ElectronMcSignalValidator::book(), MaterialBudgetCastorHistos::book(), MaterialBudgetHcalHistos::book(), ElectronMcFakeValidator::book(), MaterialBudgetForward::book(), ConversionLikelihoodCalculator::calculateLikelihood(), edm::service::ResourceEnforcer::check(), GsfElectronAlgo::ElectronData::checkCtfTrack(), DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructInsideModule(), DDHCalBarrelAlgo::constructInsideSector(), DDHCalEndcapAlgo::constructInsideSector(), CMSEmStandardPhysicsLPM::ConstructProcess(), edm::FileLocator::convert(), RPCStripsRing::createRefConnections(), PFClusterAlgo::dCrack(), PFResolutionMap::dCrackPhi(), PFEnergyCalibration::dCrackPhi(), AntiElectronIDMVA5GBR::dCrackPhi(), IsolatedGenParticles::DeltaPhi(), IsolatedTracksCone::DeltaPhi(), IsolatedTracksNxN::DeltaPhi(), Decay3Body::doDecay(), FWFFMetadataManager::doUpdate(), reco::Conversion::dPhiTracksAtEcal(), reco::Conversion::dPhiTracksAtVtx(), DAClusterizerInZ::dump(), ConversionForwardEstimator::estimate(), ConversionBarrelEstimator::estimate(), ForwardMeasurementEstimator::estimate(), BarrelMeasurementEstimator::estimate(), DDHCalTBCableAlgo::execute(), RPCStripsRing::fillWithVirtualStrips(), MCParticlePairFilter::filter(), Thrust::finalAxis(), Gauss3DFunc(), GsfElectronCoreBaseProducer::getCtfTrackRef(), ZdcSD::getEnergyDeposit(), CastorSD::getEnergyDeposit(), TopologyWorker::getetaphi(), TwoBodyDecayLinearizationPointFinder::getLinearizationPoint(), pat::helper::ResolutionHelper::getResolTheta(), Thrust::initialAxis(), HDetIdAssociator::iPhi(), CaloCellId::isInCell(), MaterialBudgetCastorHistos::MaterialBudgetCastorHistos(), MaterialBudgetHcalHistos::MaterialBudgetHcalHistos(), Utils::mpi_pi(), PFMETBenchmark::mpi_pi(), normalized_phi(), CmsTrackerLevelBuilder::ExtractPhi::operator()(), CmsTrackerLevelBuilder::ExtractPhiModule::operator()(), CmsTrackerLevelBuilder::ExtractPhiGluedModule::operator()(), CmsTrackerLevelBuilder::ExtractPhiMirror::operator()(), CmsTrackerLevelBuilder::ExtractPhiModuleMirror::operator()(), CmsTrackerLevelBuilder::ExtractPhiGluedModuleMirror::operator()(), DDHCalEndcapAlgo::parameterLayer(), DDHCalEndcapAlgo::parameterLayer0(), TopologyWorker::planes_sphe(), TopologyWorker::planes_sphe_wei(), TopologyWorker::planes_thrust(), HFFibreFiducial::PMTNumber(), FWPathsPopup::postProcessEvent(), ParticleReplacerParticleGun::produce(), HLTTauMCProducer::produce(), cms::AlCaDiJetsProducer::produce(), MuonSimHitProducer::produce(), DAClusterizerInZ::purge(), CutsIsolatorWithCorrection::result(), gen::HijingHadronizer::rotateEvtPlane(), gen::AMPTHadronizer::rotateEvtPlane(), gen::HydjetHadronizer::rotateEvtPlane(), DQMImplNet< DQMNet::Object >::sendObjectListToPeer(), FWPSetTableManager::update(), FP420Test::update(), BscTest::update(), FWPSetTableManager::updateFilter(), DAClusterizerInZ::vertices(), DDI::Tubs::volume(), DDI::Torus::volume(), DDI::Cons::volume(), DDI::Polycone::volume(), MonPNBlueDat::writeArrayDB(), MonPNGreenDat::writeArrayDB(), MonPNRedDat::writeArrayDB(), MonPNMGPADat::writeArrayDB(), MonPNLed2Dat::writeArrayDB(), MonPNIRedDat::writeArrayDB(), MonPNLed1Dat::writeArrayDB(), and DCULVRVoltagesDat::writeArrayDB().

std::vector<VertexType> Vertices

Definition at line 62 of file Vx3DHLTAnalyzer.h.

Referenced by Vx3DHLTAnalyzer::analyze(), Gauss3DFunc(), and Vx3DHLTAnalyzer::reset().

double VxErrCorr

Definition at line 72 of file Vx3DHLTAnalyzer.h.

Referenced by Gauss3DFunc(), and Vx3DHLTAnalyzer::Vx3DHLTAnalyzer().

double xPos
double yPos
double zPos