Skip to content
Snippets Groups Projects
Commit 3a53f133 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: .clang-format

	modified:   ecal/scripts/emcal_electrons.cxx
	modified:   ecal/scripts/emcal_pi0.cxx
parent 5b5d20e5
No related branches found
No related tags found
1 merge request!11WIP Smaller solid angle
--- ---
BasedOnStyle: LLVM Language: Cpp
BreakConstructorInitializersBeforeComma: true BasedOnStyle: Chromium
ConstructorInitializerAllOnOneLineOrOnePerLine: true AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
Standard: Cpp11 DerivePointerAlignment: false
#SpaceBeforeParens: ControlStatements DisableFormat: false
SpaceAfterControlStatementKeyword: true ExperimentalAutoDetectBinPacking: false
PointerBindsToType: true FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
... ...
...@@ -19,8 +19,12 @@ ...@@ -19,8 +19,12 @@
using namespace HepMC3; using namespace HepMC3;
void emcal_electrons(int n_events = 1e3, double e_start = 1.0, double e_end = 1.0, const char* out_fname = "./data/emcal_electron_0GeVto30GeV_100kEvt.hepmc") void emcal_electrons(int n_events = 1e2, double e_start = 1.0, double e_end = 1.0,
const char* out_fname = "./data/emcal_electron_0GeVto30GeV_100kEvt.hepmc")
{ {
double cos_theta_min = std::cos(M_PI * (120.0 / 180.0));
double cos_theta_max = std::cos(M_PI);
WriterAscii hepmc_output(out_fname); WriterAscii hepmc_output(out_fname);
int events_parsed = 0; int events_parsed = 0;
GenEvent evt(Units::GEV, Units::MM); GenEvent evt(Units::GEV, Units::MM);
...@@ -40,13 +44,16 @@ void emcal_electrons(int n_events = 1e3, double e_start = 1.0, double e_end = 1. ...@@ -40,13 +44,16 @@ void emcal_electrons(int n_events = 1e3, double e_start = 1.0, double e_end = 1.
FourVector(0.0, 0.0, 0.0, 0.938), 2212, 4); FourVector(0.0, 0.0, 0.0, 0.938), 2212, 4);
// Define momentum // Define momentum
Double_t p = r1->Uniform(e_start, e_end); Double_t p = r1->Uniform(0.0, 30.0);
Double_t px; Double_t phi = r1->Uniform(0.0, 2.0 * M_PI);
Double_t py; Double_t costh = r1->Uniform(cos_theta_min, cos_theta_max);
Double_t pz; Double_t th = std::acos(costh);
Double_t px = p * std::cos(phi) * std::sin(th);
Double_t py = p * std::sin(phi) * std::sin(th);
Double_t pz = p * std::cos(th);
// Generates random vectors, uniformly distributed over the surface of a // Generates random vectors, uniformly distributed over the surface of a
// sphere of given radius, in this case momentum. // sphere of given radius, in this case momentum.
r1->Sphere(px, py, pz, p); // r1->Sphere(px, py, pz, p);
//std::cout << std::sqrt(px*px + py*py + pz*pz) - p << " is zero? \n"; //std::cout << std::sqrt(px*px + py*py + pz*pz) - p << " is zero? \n";
......
...@@ -18,6 +18,9 @@ using namespace HepMC3; ...@@ -18,6 +18,9 @@ using namespace HepMC3;
void emcal_pi0(int n_events = 1e6, const char* out_fname = "./data/emcal_pi0_0GeVto30GeV_100kEvt.hepmc") void emcal_pi0(int n_events = 1e6, const char* out_fname = "./data/emcal_pi0_0GeVto30GeV_100kEvt.hepmc")
{ {
double cos_theta_min = std::cos(M_PI*(120.0/180.0));
double cos_theta_max = std::cos(M_PI);
WriterAscii hepmc_output(out_fname); WriterAscii hepmc_output(out_fname);
int events_parsed = 0; int events_parsed = 0;
GenEvent evt(Units::GEV, Units::MM); GenEvent evt(Units::GEV, Units::MM);
...@@ -37,13 +40,16 @@ void emcal_pi0(int n_events = 1e6, const char* out_fname = "./data/emcal_pi0_0Ge ...@@ -37,13 +40,16 @@ void emcal_pi0(int n_events = 1e6, const char* out_fname = "./data/emcal_pi0_0Ge
FourVector(0.0, 0.0, 0.0, 0.938), 2212, 4); FourVector(0.0, 0.0, 0.0, 0.938), 2212, 4);
// Define momentum // Define momentum
Double_t p = r1->Uniform(0.0,30.0); Double_t p = r1->Uniform(0.0, 30.0);
Double_t px; Double_t phi = r1->Uniform(0.0,2.0*M_PI);
Double_t py; Double_t costh = r1->Uniform(cos_theta_min,cos_theta_max);
Double_t pz; Double_t th = std::acos(costh);
Double_t px = p * std::cos(phi)*std::sin(th) ;
Double_t py = p * std::sin(phi)*std::sin(th) ;
Double_t pz = p * std::cos(th) ;
// Generates random vectors, uniformly distributed over the surface of a // Generates random vectors, uniformly distributed over the surface of a
// sphere of given radius, in this case momentum. // sphere of given radius, in this case momentum.
r1->Sphere(px, py, pz, p); //r1->Sphere(px, py, pz, p);
// type 1 is final state // type 1 is final state
// pdgid 111 - pi0 135 MeV/c^2 // pdgid 111 - pi0 135 MeV/c^2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment