CMS 3D CMS Logo

Classes | Defines | Functions | Variables

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/DQM/BeamMonitor/plugins/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

Defines

#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

Define Documentation

#define DIM   3

Definition at line 48 of file Vx3DHLTAnalyzer.h.

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


Function Documentation

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

Definition at line 177 of file Vx3DHLTAnalyzer.cc.

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

Referenced by Vx3DHLTAnalyzer::MyFit().

{
  double K[DIM][DIM]; // Covariance Matrix
  double M[DIM][DIM]; // K^-1
  double det;
  double sumlog = 0.;

//   par[0] = K(0,0) --> Var[X]
//   par[1] = K(1,1) --> Var[Y]
//   par[2] = K(2,2) --> Var[Z]
//   par[3] = K(0,1) = K(1,0) --> Cov[X,Y]
//   par[4] = K(1,2) = K(2,1) --> Cov[Y,Z] --> dy/dz
//   par[5] = K(0,2) = K(2,0) --> Cov[X,Z] --> dx/dz
//   par[6] = mean x
//   par[7] = mean y
//   par[8] = mean z

  counterVx = 0;
  for (unsigned int i = 0; i < Vertices.size(); i++)
    {
      if ((std::sqrt((Vertices[i].x-xPos)*(Vertices[i].x-xPos) + (Vertices[i].y-yPos)*(Vertices[i].y-yPos)) <= maxTransRadius) &&
          (std::fabs(Vertices[i].z-zPos) <= maxLongLength))
        {
          if (considerVxCovariance == true)
            {
              K[0][0] = std::fabs(par[0]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[0][0]);
              K[1][1] = std::fabs(par[1]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[1][1]);
              K[2][2] = std::fabs(par[2]) + VxErrCorr*VxErrCorr * std::fabs(Vertices[i].Covariance[2][2]);
              K[0][1] = K[1][0] = par[3] + VxErrCorr*VxErrCorr * Vertices[i].Covariance[0][1];
              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];
              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];
            }
          else
            {
              K[0][0] = std::fabs(par[0]);
              K[1][1] = std::fabs(par[1]);
              K[2][2] = std::fabs(par[2]);
              K[0][1] = K[1][0] = par[3];
              K[1][2] = K[2][1] = par[4]*(std::fabs(par[2])-std::fabs(par[1])) - par[5]*par[3];
              K[0][2] = K[2][0] = par[5]*(std::fabs(par[2])-std::fabs(par[0])) - par[4]*par[3];
            }

          det = K[0][0]*(K[1][1]*K[2][2] - K[1][2]*K[1][2]) -
                K[0][1]*(K[0][1]*K[2][2] - K[0][2]*K[1][2]) +
                K[0][2]*(K[0][1]*K[1][2] - K[0][2]*K[1][1]);

          M[0][0] = (K[1][1]*K[2][2] - K[1][2]*K[1][2]) / det;
          M[1][1] = (K[0][0]*K[2][2] - K[0][2]*K[0][2]) / det;
          M[2][2] = (K[0][0]*K[1][1] - K[0][1]*K[0][1]) / det;
          M[0][1] = M[1][0] = (K[0][2]*K[1][2] - K[0][1]*K[2][2]) / det;
          M[1][2] = M[2][1] = (K[0][2]*K[0][1] - K[1][2]*K[0][0]) / det;
          M[0][2] = M[2][0] = (K[0][1]*K[1][2] - K[0][2]*K[1][1]) / det;
          
          sumlog += double(DIM)*std::log(2.*pi) + std::log(std::fabs(det)) +
            (M[0][0]*(Vertices[i].x-par[6])*(Vertices[i].x-par[6]) +
             M[1][1]*(Vertices[i].y-par[7])*(Vertices[i].y-par[7]) +
             M[2][2]*(Vertices[i].z-par[8])*(Vertices[i].z-par[8]) +
             2.*M[0][1]*(Vertices[i].x-par[6])*(Vertices[i].y-par[7]) +
             2.*M[1][2]*(Vertices[i].y-par[7])*(Vertices[i].z-par[8]) +
             2.*M[0][2]*(Vertices[i].x-par[6])*(Vertices[i].z-par[8]));
          
          counterVx++;
        }
    }
  
  fval = sumlog;
}

Variable Documentation

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().

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(), ElectronAnalyzer::analyze(), PhotonValidator::analyze(), GsfElectronDataAnalyzer::analyze(), evf::ExceptionGenerator::analyze(), cms::DiJetAnalyzer::analyze(), ElectronMcSignalValidator::analyze(), RPCPhiEff::analyze(), HiBasicGenTest::analyze(), GsfElectronMCFakeAnalyzer::analyze(), ContainmentCorrectionAnalyzer::analyze(), ElectronSeedAnalyzer::analyze(), DTVDriftCalibration::analyze(), SimplePhotonAnalyzer::analyze(), GsfElectronMCAnalyzer::analyze(), DQMAnalyzer::analyze(), EwkDQM::analyze(), GsfElectronFakeAnalyzer::analyze(), EgammaObjects::analyzeElectrons(), EgammaObjects::analyzePhotons(), cms::DiMuonSeedGeneratorHIC::barrelUpdateSeed(), EwkDQM::beginJob(), Vx3DHLTAnalyzer::beginJob(), HiggsDQM::beginJob(), MaterialBudgetCastorHistos::book(), ElectronMcFakeValidator::book(), ElectronMcSignalValidator::book(), MaterialBudgetForward::book(), MaterialBudgetHcalHistos::book(), ConversionLikelihoodCalculator::calculateLikelihood(), tkDetUtil::calculatePhiWindow(), edm::service::ResourceEnforcer::check(), GsfElectronAlgo::ElectronData::checkCtfTrack(), TIBRing::checkPeriodicity(), NavVolume6Faces::computeBounds(), PixelBarrelLayer::computeCrossings(), TOBLayer::computeCrossings(), DTTime2DriftParametrization::computeDriftDistance_mean(), DTTime2DriftParametrization::computeDriftDistance_mode(), DDHCalEndcapAlgo::constructGeneralVolume(), DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructInsideModule(), DDHCalEndcapAlgo::constructInsideSector(), DDHCalBarrelAlgo::constructInsideSector(), Ring::containsDetId(), edm::FileLocator::convert(), HICTrajectoryCorrector::correct(), cms::HICFTSfromL1orL2::createFTSfromL1orL2(), RPCStripsRing::createRefConnections(), CylinderFromSectorMFGrid::CylinderFromSectorMFGrid(), PFClusterAlgo::dCrack(), PFEnergyCalibration::dCrackPhi(), PFResolutionMap::dCrackPhi(), IsolatedTracksCone::DeltaPhi(), IsolatedGenParticles::DeltaPhi(), IsolatedTracksNxN::DeltaPhi(), Decay3Body::doDecay(), FWFFMetadataManager::doUpdate(), reco::Conversion::dPhiTracksAtEcal(), reco::Conversion::dPhiTracksAtVtx(), DTTrigGeomUtils::DTTrigGeomUtils(), EgammaObjects::ecalEta(), EgammaSuperClusters::ecalEta(), ECALPositionCalculator::ecalEta(), ContainmentCorrectionAnalyzer::ecalEta(), edm::Schedule::endJob(), ConversionBarrelEstimator::estimate(), cms::HICSeedMeasurementEstimator::estimate(), ForwardMeasurementEstimator::estimate(), HICMeasurementEstimator::estimate(), ConversionForwardEstimator::estimate(), BarrelMeasurementEstimator::estimate(), DDHCalTBCableAlgo::execute(), RPCStripsRing::fillWithVirtualStrips(), MCParticlePairFilter::filter(), Thrust::finalAxis(), HICTrajectoryCorrector::findPhiInVertex(), HICMuonUpdator::findPhiInVertex(), cms::DiMuonSeedGeneratorHIC::forwardUpdateSeed(), cms::HICFTSfromL1orL2::FTSfromL1(), Gauss3DFunc(), GsfElectronCoreBaseProducer::getCtfTrackRef(), CastorSD::getEnergyDeposit(), ZdcSD::getEnergyDeposit(), TopologyWorker::getetaphi(), TwoBodyDecayLinearizationPointFinder::getLinearizationPoint(), EcalElectronicsMapping::GetListofFEDs(), pat::helper::ResolutionHelper::getResolTheta(), DDI::Ellipsoid::halfVol(), Thrust::initialAxis(), HDetIdAssociator::iPhi(), CaloCellId::isInCell(), ESListOfFEDSProducer::ListOfFEDS(), EcalListOfFEDSProducer::ListOfFEDS(), EcalRawToRecHitRoI::ListOfFEDS(), HLTAlCa::ListOfFEDS(), MagGeometry::MagGeometry(), MaterialBudgetCastorHistos::MaterialBudgetCastorHistos(), MaterialBudgetHcalHistos::MaterialBudgetHcalHistos(), Utils::mpi_pi(), PFMETBenchmark::mpi_pi(), normalized_phi(), SimpleConeBounds::openingAngle(), CmsTrackerLevelBuilder::ExtractPhiModule::operator()(), CmsTrackerLevelBuilder::ExtractPhiModuleMirror::operator()(), CmsTrackerLevelBuilder::ExtractPhiGluedModuleMirror::operator()(), CmsTrackerLevelBuilder::ExtractPhi::operator()(), CmsTrackerLevelBuilder::ExtractPhiGluedModule::operator()(), CmsTrackerLevelBuilder::ExtractPhiMirror::operator()(), DDHCalEndcapAlgo::parameterLayer(), DDHCalEndcapAlgo::parameterLayer0(), RoadSearchCircleSeed::Phi0(), PhiBorderFinder::PhiBorderFinder(), TopologyWorker::planes_sphe(), TopologyWorker::planes_sphe_wei(), TopologyWorker::planes_thrust(), HFFibreFiducial::PMTNumber(), FWPathsPopup::postProcessEvent(), ParticleReplacerParticleGun::produce(), cms::AlCaDiJetsProducer::produce(), MuonSimHitProducer::produce(), HLTTauMCProducer::produce(), cms::FastMuPropagator::propagate(), stor::DQMEventStore< DQMEventMsg, EventRetriever< RegInfo, QueueCollectionPtr >, StateMachine >::purge(), SteppingHelixPropagator::refToDest(), SteppingHelixPropagator::refToMagVolume(), SteppingHelixPropagator::refToMatVolume(), CutsIsolatorWithCorrection::result(), gen::AMPTHadronizer::rotateEvtPlane(), gen::HijingHadronizer::rotateEvtPlane(), gen::HydjetHadronizer::rotateEvtPlane(), RoadSearchCloudMakerAlgorithm::run(), DQMImplNet< DQMNet::Object >::sendObjectListToPeer(), Cone::side(), FWPSetTableManager::update(), FP420Test::update(), BscTest::update(), HICMuonUpdator::update(), HICMuonUpdator::updateBarrel(), HICMuonUpdator::updateEndcap(), FWPSetTableManager::updateFilter(), DDI::Cons::volume(), DDI::Ellipsoid::volume(), DDI::Tubs::volume(), DDI::Torus::volume(), DDI::Polycone::volume(), MonPNBlueDat::writeArrayDB(), MonPNGreenDat::writeArrayDB(), MonPNLed1Dat::writeArrayDB(), MonPNLed2Dat::writeArrayDB(), MonPNRedDat::writeArrayDB(), MonPNMGPADat::writeArrayDB(), DCULVRVoltagesDat::writeArrayDB(), and MonPNIRedDat::writeArrayDB().

std::vector<VertexType> Vertices

Definition at line 57 of file Vx3DHLTAnalyzer.h.

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

double VxErrCorr

Definition at line 67 of file Vx3DHLTAnalyzer.h.

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

double xPos
double yPos
double zPos