Skip to content

Commit 417cce0

Browse files
behrenhoffamadio
authored andcommitted
Correct misleading indentation
In case of VariableTransform.cxx, reformatted the whole file as it was using 4 whitespaces indentation and had misleading indentation on the bottom.
1 parent 810c952 commit 417cce0

File tree

8 files changed

+142
-131
lines changed

8 files changed

+142
-131
lines changed

geom/geom/src/TGeoArb8.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ void TGeoArb8::ComputeTwist()
369369
illegal_cross = TGeoShape::IsSegCrossing(fXY[0][0],fXY[0][1],fXY[1][0],fXY[1][1],
370370
fXY[2][0],fXY[2][1],fXY[3][0],fXY[3][1]);
371371
if (!illegal_cross)
372-
illegal_cross = TGeoShape::IsSegCrossing(fXY[4][0],fXY[4][1],fXY[5][0],fXY[5][1],
373-
fXY[6][0],fXY[6][1],fXY[7][0],fXY[7][1]);
372+
illegal_cross = TGeoShape::IsSegCrossing(fXY[4][0],fXY[4][1],fXY[5][0],fXY[5][1],
373+
fXY[6][0],fXY[6][1],fXY[7][0],fXY[7][1]);
374374
if (illegal_cross) {
375375
Error("ComputeTwist", "Shape %s type Arb8: Malformed polygon with crossing opposite segments", GetName());
376376
InspectShape();

geom/geom/src/TGeoVolume.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ void TGeoVolume::AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat,
10821082
node->SetNumber(copy_no);
10831083
node->SetOverlapping();
10841084
if (vol->GetMedium() == fMedium)
1085-
node->SetVirtual();
1085+
node->SetVirtual();
10861086
vol->Grab();
10871087
}
10881088

gui/fitpanel/src/TFitEditor.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3142,7 +3142,7 @@ void TFitEditor::DoLibrary(Bool_t on)
31423142
if ( fLibGSL->GetState() != kButtonDisabled )
31433143
fLibGSL->SetState(kButtonUp);
31443144
if ( fLibGenetics->GetState() != kButtonDisabled )
3145-
fLibGenetics->SetState(kButtonUp);
3145+
fLibGenetics->SetState(kButtonUp);
31463146
fStatusBar->SetText("LIB Minuit", 1);
31473147
}
31483148

html/src/TClassDocOutput.cxx

+2-3
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,8 @@ Bool_t TClassDocOutput::ClassDotCharts(std::ostream& out)
419419
gSystem->PrependPathName("inh", filenameInh);
420420
gSystem->PrependPathName(fHtml->GetOutputDir(), filenameInh);
421421
filenameInh += "_Inh";
422-
if (!CreateDotClassChartInh(filenameInh + ".dot") ||
423-
!RunDot(filenameInh, &out))
424-
return kFALSE;
422+
if (!CreateDotClassChartInh(filenameInh + ".dot") || !RunDot(filenameInh, &out))
423+
return kFALSE;
425424

426425
TString filenameInhMem(title);
427426
gSystem->PrependPathName("inhmem", filenameInhMem);

proof/proof/src/TProof.cxx

+5-5
Original file line numberDiff line numberDiff line change
@@ -3861,7 +3861,7 @@ Int_t TProof::HandleInputMessage(TSlave *sl, TMessage *mess, Bool_t deactonfail)
38613861
ourwi->SetSysInfo(slinfo->GetSysInfo());
38623862
ourwi->fHostName = slinfo->GetName();
38633863
if (slinfo->GetDataDir() && (strlen(slinfo->GetDataDir()) > 0))
3864-
ourwi->fDataDir = slinfo->GetDataDir();
3864+
ourwi->fDataDir = slinfo->GetDataDir();
38653865
break;
38663866
}
38673867
}
@@ -10402,10 +10402,10 @@ void TProof::ShowLog(Int_t qry)
1040210402
UInt_t tolog = (UInt_t)(endlog - startlog);
1040310403

1040410404
// Perhaps nothing
10405-
if (tolog <= 0)
10406-
10407-
// Set starting point
10408-
lseek(fileno(fLogFileR), startlog, SEEK_SET);
10405+
if (tolog <= 0) {
10406+
// Set starting point
10407+
lseek(fileno(fLogFileR), startlog, SEEK_SET);
10408+
}
1040910409

1041010410
// Now we go
1041110411
Int_t np = 0;

tmva/tmva/src/MethodBase.cxx

+4-3
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,10 @@ std::vector<Double_t> TMVA::MethodBase::GetMvaValues(Long64_t firstEvt, Long64_t
899899
Timer timer( nEvents, GetName(), kTRUE );
900900

901901
if (logProgress)
902-
Log() << kHEADER<<Form("[%s] : ",DataInfo().GetName())<< "Evaluation of " << GetMethodName() << " on "
903-
<< (Data()->GetCurrentType()==Types::kTraining?"training":"testing") << " sample (" << nEvents << " events)" << Endl;
904-
902+
Log() << kHEADER << Form("[%s] : ",DataInfo().GetName())
903+
<< "Evaluation of " << GetMethodName() << " on "
904+
<< (Data()->GetCurrentType() == Types::kTraining ? "training" : "testing")
905+
<< " sample (" << nEvents << " events)" << Endl;
905906

906907
for (Int_t ievt=firstEvt; ievt<lastEvt; ievt++) {
907908
Data()->SetCurrentEvent(ievt);

tmva/tmva/src/Tools.cxx

+4-3
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ const TMatrixD* TMVA::Tools::GetCorrelationMatrix( const TMatrixD* covMat )
348348
for (Int_t jvar=0; jvar<nvar; jvar++) {
349349
if (ivar != jvar) {
350350
Double_t d = (*covMat)(ivar, ivar)*(*covMat)(jvar, jvar);
351-
if (d > 1E-20) (*corrMat)(ivar, jvar) = (*covMat)(ivar, jvar)/TMath::Sqrt(d);
352-
else {
353-
Log() << "<GetCorrelationMatrix> zero variances for variables "
351+
if (d > 1E-20) {
352+
(*corrMat)(ivar, jvar) = (*covMat)(ivar, jvar)/TMath::Sqrt(d);
353+
} else {
354+
Log() << "<GetCorrelationMatrix> zero variances for variables "
354355
<< "(" << ivar << ", " << jvar << ")" << Endl;
355356
(*corrMat)(ivar, jvar) = 0;
356357
}

tmva/tmva/src/VariableTransform.cxx

+123-113
Original file line numberDiff line numberDiff line change
@@ -64,120 +64,130 @@
6464
/// create variable transformations
6565

6666
namespace TMVA {
67-
void CreateVariableTransforms( const TString& trafoDefinitionIn,
68-
TMVA::DataSetInfo& dataInfo,
69-
TMVA::TransformationHandler& transformationHandler,
70-
TMVA::MsgLogger& log )
67+
void CreateVariableTransforms(const TString& trafoDefinitionIn,
68+
TMVA::DataSetInfo& dataInfo,
69+
TMVA::TransformationHandler& transformationHandler,
70+
TMVA::MsgLogger& log)
7171
{
72-
TString trafoDefinition(trafoDefinitionIn);
73-
if (trafoDefinition == "None") return; // no transformations
74-
75-
// workaround for transformations to complicated to be handled by makeclass
76-
// count number of transformations with incomplete set of variables
77-
TString trafoDefinitionCheck(trafoDefinitionIn);
78-
int npartial = 0, ntrafo=0;
79-
for (Int_t pos = 0, siz = trafoDefinition.Sizeof(); pos < siz; ++pos) {
80-
TString ch = trafoDefinition(pos,1);
81-
if ( ch == "(" ) npartial++;
82-
if ( ch == "+" || ch == ",") ntrafo++;
83-
}
84-
if (npartial>1) {
85-
log << kWARNING << "The use of multiple partial variable transformations during the application phase can be properly invoked via the \"Reader\", but it is not yet implemented in \"MakeClass\", the creation mechanism for standalone C++ application classes. The standalone C++ class produced by this training job is thus INCOMPLETE AND MUST NOT BE USED! The transformation in question is: " << trafoDefinitionIn << Endl; // ToDo make info and do not write the standalone class
86-
//
87-
// this does not work since this function is static
88-
// fDisableWriting=true; // disable creation of stand-alone class
89-
// ToDo we need to tell the transformation that it cannot write itself
90-
}
91-
// workaround end
92-
93-
Int_t parenthesisCount = 0;
94-
for (Int_t position = 0, size = trafoDefinition.Sizeof(); position < size; ++position) {
95-
TString ch = trafoDefinition(position,1);
96-
if (ch == "(") ++parenthesisCount;
97-
else if (ch == ")") --parenthesisCount;
98-
else if (ch == "," && parenthesisCount == 0) trafoDefinition.Replace(position,1,'+');
99-
}
100-
101-
TList* trList = gTools().ParseFormatLine( trafoDefinition, "+" );
102-
TListIter trIt(trList);
103-
while (TObjString* os = (TObjString*)trIt()) {
104-
TString tdef = os->GetString();
105-
Int_t idxCls = -1;
106-
107-
TString variables = "";
108-
if (tdef.Contains("(")) { // contains selection of variables
109-
Ssiz_t parStart = tdef.Index( "(" );
110-
Ssiz_t parLen = tdef.Index( ")", parStart )-parStart+1;
111-
112-
variables = tdef(parStart,parLen);
113-
tdef.Remove(parStart,parLen);
114-
variables.Remove(parLen-1,1);
115-
variables.Remove(0,1);
116-
}
117-
118-
TList* trClsList = gTools().ParseFormatLine( tdef, "_" ); // split entry to get trf-name and class-name
119-
TListIter trClsIt(trClsList);
120-
if (trClsList->GetSize() < 1) log << kFATAL <<Form("Dataset[%s] : ",dataInfo.GetName())<< "Incorrect transformation string provided." << Endl;
121-
const TString& trName = ((TObjString*)trClsList->At(0))->GetString();
122-
123-
if (trClsList->GetEntries() > 1) {
124-
TString trCls = "AllClasses";
125-
ClassInfo *ci = NULL;
126-
trCls = ((TObjString*)trClsList->At(1))->GetString();
127-
if (trCls != "AllClasses") {
128-
ci = dataInfo.GetClassInfo( trCls );
129-
if (ci == NULL)
130-
log << kFATAL <<Form("Dataset[%s] : ",dataInfo.GetName())<< "Class " << trCls << " not known for variable transformation "
131-
<< trName << ", please check." << Endl;
132-
else
133-
idxCls = ci->GetNumber();
134-
}
135-
}
136-
137-
VariableTransformBase* transformation = NULL;
138-
if (trName == "I" || trName == "Ident" || trName == "Identity") {
139-
if (variables.Length() == 0) variables = "_V_";
140-
transformation = new VariableIdentityTransform( dataInfo);
141-
}
142-
else if (trName == "D" || trName == "Deco" || trName == "Decorrelate") {
143-
if (variables.Length() == 0) variables = "_V_";
144-
transformation = new VariableDecorrTransform( dataInfo);
145-
}
146-
else if (trName == "P" || trName == "PCA") {
147-
if (variables.Length() == 0) variables = "_V_";
148-
transformation = new VariablePCATransform ( dataInfo);
149-
}
150-
else if (trName == "U" || trName == "Uniform") {
151-
if (variables.Length() == 0) variables = "_V_,_T_";
152-
transformation = new VariableGaussTransform ( dataInfo, "Uniform" );
153-
}
154-
else if (trName == "G" || trName == "Gauss") {
155-
if (variables.Length() == 0) variables = "_V_";
156-
transformation = new VariableGaussTransform ( dataInfo);
157-
}
158-
else if (trName == "N" || trName == "Norm" || trName == "Normalise" || trName == "Normalize") {
159-
if (variables.Length() == 0) variables = "_V_,_T_";
160-
transformation = new VariableNormalizeTransform( dataInfo);
161-
}
162-
else log << kFATAL <<Form("Dataset[%s] : ",dataInfo.GetName())<< "<ProcessOptions> Variable transform '"
163-
<< trName << "' unknown." << Endl;
164-
165-
166-
if (transformation) {
167-
ClassInfo* clsInfo = dataInfo.GetClassInfo(idxCls);
168-
if (clsInfo )
169-
log << kHEADER <<Form("[%s] : ",dataInfo.GetName())
170-
<< "Create Transformation \"" << trName << "\" with reference class "
171-
<< clsInfo->GetName() << "=("<< idxCls <<")"<<Endl << Endl;
172-
else
173-
log << kHEADER <<Form("[%s] : ",dataInfo.GetName())
174-
<< "Create Transformation \"" << trName << "\" with events from all classes." << Endl << Endl;
175-
176-
transformation->SelectInput( variables );
177-
transformationHandler.AddTransformation(transformation, idxCls);
178-
}
179-
}
180-
return;
72+
TString trafoDefinition(trafoDefinitionIn);
73+
if (trafoDefinition == "None") return; // no transformations
74+
75+
// workaround for transformations to complicated to be handled by makeclass
76+
// count number of transformations with incomplete set of variables
77+
TString trafoDefinitionCheck(trafoDefinitionIn);
78+
int npartial = 0, ntrafo = 0;
79+
for (Int_t pos = 0, siz = trafoDefinition.Sizeof(); pos < siz; ++pos) {
80+
TString ch = trafoDefinition(pos,1);
81+
if ( ch == "(" ) npartial++;
82+
if ( ch == "+" || ch == ",") ntrafo++;
83+
}
84+
if (npartial>1) {
85+
log << kWARNING
86+
<< "The use of multiple partial variable transformations during the "
87+
"application phase can be properly invoked via the \"Reader\", but "
88+
"it is not yet implemented in \"MakeClass\", the creation mechanism "
89+
"for standalone C++ application classes. The standalone C++ class "
90+
"produced by this training job is thus INCOMPLETE AND MUST NOT BE USED! "
91+
"The transformation in question is: " << trafoDefinitionIn << Endl;
92+
// ToDo make info and do not write the standalone class
93+
//
94+
// this does not work since this function is static
95+
// fDisableWriting=true; // disable creation of stand-alone class
96+
// ToDo we need to tell the transformation that it cannot write itself
97+
}
98+
// workaround end
99+
100+
Int_t parenthesisCount = 0;
101+
for (Int_t position = 0, size = trafoDefinition.Sizeof(); position < size; ++position) {
102+
TString ch = trafoDefinition(position,1);
103+
if (ch == "(") ++parenthesisCount;
104+
else if (ch == ")") --parenthesisCount;
105+
else if (ch == "," && parenthesisCount == 0) trafoDefinition.Replace(position,1,'+');
106+
}
107+
108+
TList* trList = gTools().ParseFormatLine( trafoDefinition, "+" );
109+
TListIter trIt(trList);
110+
while (TObjString* os = (TObjString*)trIt()) {
111+
TString tdef = os->GetString();
112+
Int_t idxCls = -1;
113+
114+
TString variables = "";
115+
if (tdef.Contains("(")) { // contains selection of variables
116+
Ssiz_t parStart = tdef.Index( "(" );
117+
Ssiz_t parLen = tdef.Index( ")", parStart )-parStart+1;
118+
119+
variables = tdef(parStart,parLen);
120+
tdef.Remove(parStart,parLen);
121+
variables.Remove(parLen-1,1);
122+
variables.Remove(0,1);
123+
}
124+
125+
TList* trClsList = gTools().ParseFormatLine( tdef, "_" ); // split entry to get trf-name and class-name
126+
TListIter trClsIt(trClsList);
127+
if (trClsList->GetSize() < 1)
128+
log << kFATAL <<Form("Dataset[%s] : ",dataInfo.GetName())<< "Incorrect transformation string provided." << Endl;
129+
const TString& trName = ((TObjString*)trClsList->At(0))->GetString();
130+
131+
if (trClsList->GetEntries() > 1) {
132+
TString trCls = "AllClasses";
133+
ClassInfo *ci = NULL;
134+
trCls = ((TObjString*)trClsList->At(1))->GetString();
135+
if (trCls != "AllClasses") {
136+
ci = dataInfo.GetClassInfo( trCls );
137+
if (ci == NULL)
138+
log << kFATAL <<Form("Dataset[%s] : ",dataInfo.GetName())<< "Class " << trCls << " not known for variable transformation "
139+
<< trName << ", please check." << Endl;
140+
else
141+
idxCls = ci->GetNumber();
142+
}
143+
}
144+
145+
VariableTransformBase* transformation = NULL;
146+
if (trName == "I" || trName == "Ident" || trName == "Identity") {
147+
if (variables.Length() == 0) variables = "_V_";
148+
transformation = new VariableIdentityTransform(dataInfo);
149+
}
150+
else if (trName == "D" || trName == "Deco" || trName == "Decorrelate") {
151+
if (variables.Length() == 0) variables = "_V_";
152+
transformation = new VariableDecorrTransform(dataInfo);
153+
}
154+
else if (trName == "P" || trName == "PCA") {
155+
if (variables.Length() == 0) variables = "_V_";
156+
transformation = new VariablePCATransform(dataInfo);
157+
}
158+
else if (trName == "U" || trName == "Uniform") {
159+
if (variables.Length() == 0) variables = "_V_,_T_";
160+
transformation = new VariableGaussTransform(dataInfo, "Uniform" );
161+
}
162+
else if (trName == "G" || trName == "Gauss") {
163+
if (variables.Length() == 0) variables = "_V_";
164+
transformation = new VariableGaussTransform(dataInfo);
165+
}
166+
else if (trName == "N" || trName == "Norm" || trName == "Normalise" || trName == "Normalize") {
167+
if (variables.Length() == 0) variables = "_V_,_T_";
168+
transformation = new VariableNormalizeTransform(dataInfo);
169+
}
170+
else
171+
log << kFATAL << Form("Dataset[%s] : ",dataInfo.GetName())
172+
<< "<ProcessOptions> Variable transform '"
173+
<< trName << "' unknown." << Endl;
174+
175+
176+
if (transformation) {
177+
ClassInfo* clsInfo = dataInfo.GetClassInfo(idxCls);
178+
if (clsInfo)
179+
log << kHEADER << Form("[%s] : ",dataInfo.GetName())
180+
<< "Create Transformation \"" << trName << "\" with reference class "
181+
<< clsInfo->GetName() << "=("<< idxCls <<")" << Endl << Endl;
182+
else
183+
log << kHEADER << Form("[%s] : ",dataInfo.GetName())
184+
<< "Create Transformation \"" << trName << "\" with events from all classes."
185+
<< Endl << Endl;
186+
187+
transformation->SelectInput(variables);
188+
transformationHandler.AddTransformation(transformation, idxCls);
189+
}
190+
}
181191
}
182192

183193
}

0 commit comments

Comments
 (0)