CMS 3D CMS Logo

Functions
DDG4ProductionCuts.cc File Reference
#include "SimG4Core/Physics/interface/DDG4ProductionCuts.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "G4ProductionCuts.hh"
#include "G4RegionStore.hh"
#include <algorithm>

Go to the source code of this file.

Functions

bool dd_is_greater (const std::pair< G4LogicalVolume *, DDLogicalPart > &p1, const std::pair< G4LogicalVolume *, DDLogicalPart > &p2)
 

Function Documentation

bool dd_is_greater ( const std::pair< G4LogicalVolume *, DDLogicalPart > &  p1,
const std::pair< G4LogicalVolume *, DDLogicalPart > &  p2 
)

helper function to compare parts through their name instead of comparing them by their pointers. It's guaranteed to produce the same order in subsequent application runs, while pointers usually can't guarantee this

Definition at line 26 of file DDG4ProductionCuts.cc.

References mps_fire::result.

Referenced by DDG4ProductionCuts::initialize().

27  {
28  bool result = false;
29  if (p1.second.name().ns() > p2.second.name().ns()) {
30  result = true;
31  }
32  if (p1.second.name().ns() == p2.second.name().ns()) {
33  if (p1.second.name().name() > p2.second.name().name()) {
34  result = true;
35  }
36  if (p1.second.name().name() == p2.second.name().name()) {
37  if (p1.first->GetName() > p2.first->GetName()) {
38  result = true;
39  }
40  }
41  }
42  return result;
43 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89