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

void Gauss3DFunc (int &, double *, double &fval, double *par, int)
 

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

void Gauss3DFunc ( int &  ,
double *  ,
double &  fval,
double *  par,
int   
)

Definition at line 178 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().

179 {
180  double K[DIM][DIM]; // Covariance Matrix
181  double M[DIM][DIM]; // K^-1
182  double det;
183  double sumlog = 0.;
184 
185 // par[0] = K(0,0) --> Var[X]
186 // par[1] = K(1,1) --> Var[Y]
187 // par[2] = K(2,2) --> Var[Z]
188 // par[3] = K(0,1) = K(1,0) --> Cov[X,Y]
189 // par[4] = K(1,2) = K(2,1) --> Cov[Y,Z] --> dy/dz
190 // par[5] = K(0,2) = K(2,0) --> Cov[X,Z] --> dx/dz
191 // par[6] = mean x
192 // par[7] = mean y
193 // par[8] = mean z
194 
195  counterVx = 0;
196  for (unsigned int i = 0; i < Vertices.size(); i++)
197  {
199  (std::fabs(Vertices[i].z-zPos) <= maxLongLength))
200  {
201  if (considerVxCovariance == true)
202  {
203  K[0][0] = std::fabs(par[0]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[0][0]);
204  K[1][1] = std::fabs(par[1]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[1][1]);
205  K[2][2] = std::fabs(par[2]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[2][2]);
206  K[0][1] = K[1][0] = par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][1];
207  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];
208  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];
209  }
210  else
211  {
212  K[0][0] = std::fabs(par[0]);
213  K[1][1] = std::fabs(par[1]);
214  K[2][2] = std::fabs(par[2]);
215  K[0][1] = K[1][0] = par[3];
216  K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
217  K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
218  }
219 
220  det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
221  K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
222  K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);
223 
224  M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
225  M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
226  M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
227  M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
228  M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
229  M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
230 
231  sumlog += double(DIM)*std::log(2.*pi) + std::log(std::fabs(det)) +
232  (M[0][0]*(Vertices[i].x-par[6])*(Vertices[i].x-par[6]) +
233  M[1][1]*(Vertices[i].y-par[7])*(Vertices[i].y-par[7]) +
234  M[2][2]*(Vertices[i].z-par[8])*(Vertices[i].z-par[8]) +
235  2.*M[0][1]*(Vertices[i].x-par[6])*(Vertices[i].y-par[7]) +
236  2.*M[1][2]*(Vertices[i].y-par[7])*(Vertices[i].z-par[8]) +
237  2.*M[0][2]*(Vertices[i].x-par[6])*(Vertices[i].z-par[8]));
238 
239  counterVx++;
240  }
241  }
242 
243  fval = sumlog;
244 }
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 58 of file Vx3DHLTAnalyzer.h.

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

unsigned int counterVx
double maxLongLength

Definition at line 61 of file Vx3DHLTAnalyzer.h.

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

double maxTransRadius

Definition at line 60 of file Vx3DHLTAnalyzer.h.

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

double pi

Definition at line 63 of file Vx3DHLTAnalyzer.h.

Referenced by Hector::addPartToHepMC(), ElectronMcFakeValidator::analyze(), ElectronMcSignalValidator::analyze(), HiBasicGenTest::analyze(), ElectronAnalyzer::analyze(), evf::ExceptionGenerator::analyze(), ElectronSeedAnalyzer::analyze(), SimplePhotonAnalyzer::analyze(), GsfElectronDataAnalyzer::analyze(), GsfElectronMCFakeAnalyzer::analyze(), RPCPhiEff::analyze(), DQMAnalyzer::analyze(), GsfElectronFakeAnalyzer::analyze(), GsfElectronMCAnalyzer::analyze(), ContainmentCorrectionAnalyzer::analyze(), cms::DiJetAnalyzer::analyze(), PhotonValidator::analyze(), EwkDQM::beginJob(), BasicHepMCHeavyIonValidation::beginJob(), HiggsDQM::beginJob(), Vx3DHLTAnalyzer::beginJob(), ExoticaDQM::beginJob(), ElectronMcFakeValidator::book(), ElectronMcSignalValidator::book(), MaterialBudgetCastorHistos::book(), MaterialBudgetHcalHistos::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(), AntiElectronIDMVA3::dCrackPhi(), IsolatedGenParticles::DeltaPhi(), IsolatedTracksCone::DeltaPhi(), IsolatedTracksNxN::DeltaPhi(), Decay3Body::doDecay(), FWFFMetadataManager::doUpdate(), reco::Conversion::dPhiTracksAtEcal(), reco::Conversion::dPhiTracksAtVtx(), DAClusterizerInZ::dump(), edm::Schedule::endJob(), 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(), HLTTauMCProducer::produce(), ParticleReplacerParticleGun::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::Polycone::volume(), DDI::Cons::volume(), MonPNLed2Dat::writeArrayDB(), MonPNRedDat::writeArrayDB(), MonPNBlueDat::writeArrayDB(), MonPNMGPADat::writeArrayDB(), MonPNIRedDat::writeArrayDB(), MonPNGreenDat::writeArrayDB(), MonPNLed1Dat::writeArrayDB(), and DCULVRVoltagesDat::writeArrayDB().

std::vector<VertexType> Vertices

Definition at line 57 of file Vx3DHLTAnalyzer.h.

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

double VxErrCorr

Definition at line 67 of file Vx3DHLTAnalyzer.h.

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

double xPos
double yPos
double zPos