CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DDG4ProductionCuts.cc File Reference
#include "SimG4Core/Physics/interface/DDG4ProductionCuts.h"
#include "SimG4Core/Notification/interface/SimG4Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.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 23 of file DDG4ProductionCuts.cc.

References query::result.

Referenced by DDG4ProductionCuts::initialize().

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