﻿__group__	ticket	summary	component	version	type	owner	status	created	_changetime	_description	_reporter
Milestone 	10	Seg fault in Ceres when outpath does not exist	component1		defect	somebody	new	2014-10-28T15:56:44Z	2014-10-28T15:56:44Z	"Ceres produces a segmentation violation when the --out path points to a non existing location
This was found in r17991."	smueller
Milestone 	12	Build error with CERN ROOT 5.34/21	component1		defect	somebody	new	2014-11-07T22:48:03Z	2014-11-07T23:02:04Z	"When building Mars using the latest and recommended (November 2014) CERN ROOT version 5.34/21 on Ubuntu 14.04 64bit, there are build errors concerning {{{mbase/MQuarternion.h}}} and {{{msim/MPhotonData.h}}}. In both these header files the sqrt() is 'redefined' from 'sqrt' to 'sqrt ::sqrt'.

In the header files it looks like:
{{{
#ifndef ROOT_TQuaternion
#include <math.h>
#define sqrt ::sqrt
#include <TQuaternion.h>
#undef sqrt
#endif
}}}

The build error looks like:
{{{
In file included from MPhotonData.cc:43:0:
/usr/include/c++/4.8/bits/random.h: In member function ‘std::student_t_distribution<_RealType>::result_type std::student_t_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&)’:
MPhotonData.h:20:14: error: expected unqualified-id before ‘::’ token
 #define sqrt ::sqrt
              ^
}}} "	smueller
Milestone 	23	MMatrix does not compile	component1		defect	Thomas	new	2014-12-23T10:35:38Z	2014-12-23T11:02:01Z	"This is an email from Thomas sent on FACT Online on Sat 2014-Dec-20:

Dear colleagues,

since I always get loud complains if something in the svn doesn't compile, I take the freedom to complain as well ;)

Please fix that (it actually obviously does not comply with the standard which does ONLY allow to instatiate const-static data members in the class header. I am surprised that any compiler compiles that)

In file included from MMatrix.cc:27:0:
MMatrix.h:34:23: sorry, unimplemented: non-static data member initializers
MMatrix.h:34:23: error: ISO C++ forbids in-class initialization of non-const static member ‘fDelimiter’
MMatrix.h:39:21: sorry, unimplemented: non-static data member initializers
MMatrix.h:39:21: error: ISO C++ forbids in-class initialization of non-const static member ‘fComment’
MMatrix.h:43:25: sorry, unimplemented: non-static data member initializers
MMatrix.h:43:25: error: in-class initialization of static data member ‘fFileName’ of non-literal type
MMatrix.h:48:32: sorry, unimplemented: non-static data member initializers
MMatrix.h:48:32: error: ISO C++ forbids in-class initialization of non-const static member ‘fLineNumber’
MMatrix.cc: In member function ‘void MMatrix::ReadFile(TString)’:
MMatrix.cc:93:3: error: ‘fFileName’ was not declared in this scope
MMatrix.cc: In member function ‘double MMatrix::pedantic_strtod(std::string) const’:
MMatrix.cc:146:26: error: ‘fFileName’ was not declared in this scope
MMatrix.cc:170:26: error: ‘fFileName’ was not declared in this scope
MMatrix.cc: In member function ‘void MMatrix::print() const’:
MMatrix.cc:203:25: error: ‘fFileName’ was not declared in this scope
MMatrix.cc: In member function ‘virtual Int_t MMatrix::ReadEnv(const TEnv&, TString, Bool_t)’:
MMatrix.cc:292:46: error: ‘fFileName’ was not declared in this scope

Side remark: You cannot include time offsets in each pixels without respecting them in the calculation of the noise-window as well.

Thanks,
Thomas."	smueller
Milestone 	25	"Main.js throws exception during 'emergency' shutdown due to ""sunrise detected"""	component1		defect	somebody	new	2015-01-29T07:34:37Z	2015-01-29T07:34:37Z	"
Link to logbook:
https://www.fact-project.org/logbook/showthread.php?tid=2996&pid=16810#pid16810

It tries to initiate an emergency shutdown, because it detected the sunrise 200ms **after** the regualr shutdown task was already successfully finished. While this by itself would not be a problem, the script throws an exception due to a timeout when waiting for the FEEDBACK program to reach the Calibrated state, which is not possible anymore, since the BIASCTRL is already disconnected and therefor FEEDBACK will stay in Connecting, until the BIASCTRL received the RECONNECT and FEEDBACK. recieves either the CALIBRATE or LOAD_CALIBRATION commands. So the Main.js gracefully dies while trying to perform an shutdown due to ""sunrise detected"". This is maybe the one and only thing that should never ever happen!

Here is the output regarding this issue
{{{
 #> 07:04:04.334314 - Starting shutdown.
 #> 07:04:04.334508 - Stoping feedback.
 #> 07:04:04.588081 - Switching voltage to Uov=0V.
 #> 07:04:07.838667 - Closing lid.
 #> 07:04:29.239477 - Lid closed [21.4s]

Waiting for telescope to park. This may take a while.
 #> 07:04:54.669194 - Taking single-pe run.
 #> 07:04:54.669470 - Stoping feedback.
 #> 07:04:54.769531 - Switching voltage to Uov=1.1V.
 #> 07:04:57.910011 - Waiting for voltage to be stable.
  DeltaUov=-0.002 (NaN) [N(>0.033V)=6]
  DeltaUov=-0.002 (0.000) [N(>0.033V)=6]
  DeltaUov=-0.002 (-0.001) [N(>0.033V)=3]
  DeltaUov=-0.002 (0.000) [N(>0.033V)=3]
  DeltaUov=-0.001 (0.001) [N(>0.033V)=4]
  DeltaUov=-0.001 (-0.000) [N(>0.033V)=5]
  DeltaUov=-0.001 (0.000) [N(>0.033V)=1]
 #> 07:05:00.732035 - Voltage stable within limits
 #> 07:05:00.732211 - Taking single p.e. run.
 #> 07:05:00.732471 - Take run 258: N=10000 T=-1s [single-pe]
 #> 07:07:13.194675 - Switching voltage off.
 #> 07:07:35.306508 - Voltage off.
 #> 07:07:35.306700 - Finishing shutdown.

Shutdown procedure seems to be finished...
  Thu, 29 Jan 2015 07:07:35 GMT
  Telescope at Zd=101.0deg Az=0.0deg
  Please check on the web cam that the park position was reached
  and the telescope is not moving anymore.
  Please check visually that the lid is really closed and
  that the biasctrl really switched the voltage off.

    DRIVE_CONTROL: Locked
    FEEDBACK:      Calibrated
    FTM_CONTROL:   Valid
    BIAS_CONTROL:  Disconnected

 #> 07:07:35.524009 - Shutdown: end [24.905s, 186.067s, 0.217s]

 #> 07:07:35.524262 - Task finished [SHUTDOWN]


 #> 07:07:35.723575 - Sun rise detected.... automatic shutdown initiated!
 #> 07:07:35.724864 - Starting shutdown.

Waiting for telescope to park. This may take a while.
  Voltage off: bias crate disconnected!
 #> 07:07:35.916434 - Finishing shutdown.
 E> 07:07:39.092999 - | scripts/Main.js: l.460: Error: Waiting for state ""Calibrated"" of server FEEDBACK timed out. [main]
 E> 07:07:39.093366 - |     dim.wait(""FEEDBACK"",     ""Calibrated"",   3000);
 E> 07:07:39.093611 - |         ^
 E> 07:07:39.096152 - |
 E> 07:07:39.096339 - | Error: Waiting for state ""Calibrated"" of server FEEDBACK timed out.
 E> 07:07:39.096534 - |     at internal:1:254
 E> 07:07:39.096732 - |     at internal:1:343
 E> 07:07:39.096874 - |     at Shutdown (scripts/Main.js:460:9)
 E> 07:07:39.097050 - |     at scripts/Main.js:828:9
 E> 07:07:39.097235 - |     at main:1:1
 -> 07:07:39.110471 - State Transition from Running[3] to Idle[0] (0:scripts/Main.js[fact:4282])
}}}"	dneise
Milestone 	26	Error compiling Mars with gcc 5.3	component1		defect	somebody	new	2016-09-06T16:11:34+01:00	2016-09-06T18:43:14+01:00	"Trying to compile Mars on Ubuntu 16.04 with gcc 5.3 I get the following error:


{{{
MTime.cc: In member function 'virtual Bool_t MTime::AsciiWrite(std::ostream&) const':
MTime.cc:1154:12: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'Bool_t {aka bool}' in return
     return out;
            ^
}}}
"	mnoethe
Milestone 	28	SmartFact only shows log until first observation	component1		defect	somebody	new	2016-09-25T19:39:24+01:00	2016-09-25T21:48:37+01:00	"After the recent upgrade, smartfact seems only to show the log until the first observation started.

The last entry always was the switching off command for the IR Cam."	mnoethe
Milestone 	4	Simulate SiPM time jitter	component1		enhancement	somebody	new	2014-04-08T12:38:07+01:00	2014-04-08T12:38:07+01:00	"(This ticket is derived from a mail from Thomas Bretz) 

Currently the time jitter of the G-APDs themselves is not at all simulated. 
"	dneise
Milestone 	6	biased light pulser based calibration	component1		enhancement	somebody	new	2014-04-08T12:42:03+01:00	2014-04-08T12:42:03+01:00	"(This ticket is derived from a mail from Thomas Bretz)

The current (light pulser based) calibration introduces a systematic offset and an inhomogeneity in the camera (for the most recent data).

We should try to devise a method which overcomes these limitations."	dneise
Milestone 	15	Why no exceptions?	component1		enhancement	somebody	new	2014-11-13T10:49:36Z	2014-11-13T17:02:37Z	"I wonder, why so often return values are used to check if a method works in Mars.
Why are exceptions used so rarely? I checked it ... they work, also on the ROOT interpreter, so this time it's not ROOTs fault ;-)

I propose to make more use of exceptions and put missing exceptions in asap."	dneise
Milestone 	16	configuration file might confuse users due to implicit settings	component1		enhancement	somebody	new	2014-11-14T09:49:02Z	2014-11-14T12:57:40Z	"I believe, there is a source of confusion in the design of handling the configuration of the telescope simulation, that could be solved by dropping a feature or two.

== Problem description ==
In the current design, the user does not have to explicitly state **all** parameters, that are needed to specify the behavior of the tasks that form the entirety of our telescope simulation. Instead she might omit parameters, because she can be sure that missing parameters are set to some default parameters she finds suitable.

If the defaults are changed, without here knowing about, she has a problem. 

If she gives the configuration file to somebody who doesn't know about all defaults of the task, the person does not understand what she intended with that specific version of the configuration file. So in order to explain her intentions to her colleagues, she puts comments into the configuration file, that state the value of the default parameters for the interested reader. While her intentions are certainly noble, the outcome is even worse, because now somebody might accidentally change a comment in the configuration file and thus creating lies in the configuration file, lurking in the dark and waiting to confuse the next reader. 

I think, one virtue of scientists should be to be very specific in their discussions. Since the configuration file of the telescope simulation has been topic of long discussions, and certainly will be in the future, it should be very explicit and specific.

== Proposal ==
A way to overcome this problem, would be to request full specification of simulation tasks in the configuration file and abort the simulation in case of unspecified settings.

There are many examples, e.g. the simulation of the atmosphere, implemented in the task called MSimAtmosphere. This task reads some parameters from two files, this fact is entirely hidden from the user (let alone that she can't even change the file paths via the configuration file).
"	dneise
Milestone 	2	Verify DrsCalibrateTime	component1		task	dneise	accepted	2014-04-08T12:25:36+01:00	2014-04-08T12:27:47+01:00	"The calculation of the calibration constants to perform the calibration against the so called DRS4 systematic time aperture jitter, is done in DrsCalibrateTime in Mars/mcore/DrsCalib.h. 

We should try to verify the unbiased calculation of these calibration constants given the data we currently have."	dneise
Milestone 	7	crosstalk variations	component1		task	somebody	new	2014-04-08T12:43:47+01:00	2014-04-08T12:43:47+01:00	"(This ticket is derived from a mail from Thomas Bretz) 

The crosstalk is changing due to temperature variation from run to run (in the worst case that can be 11% and 19%).

DN: So with respect of detector simulation it would be interesting to study the effect of these variations and see how to include them into the simulation."	dneise
Milestone 	8	crosscheck PDE simulation	component1		task	somebody	new	2014-04-08T12:45:19+01:00	2014-04-08T12:45:19+01:00	"(This ticket is derived from a mail from Thomas Bretz) 

The PDE curve is most probably not correctly normalized (First, I am not sure we really use the latest and best results available for this sensors and I think we once decided to normalize to Uov=1.1V while now we know that we operate at 1.4V) "	dneise
Milestone 	3	Writing of all primitive datatypes and arrays of them in the fits output	component1		enhancement	somebody	new	2014-04-08T12:27:38+01:00	2014-04-08T12:27:38+01:00	"It would be nice, that mfileio/MWriteFitsFile would have the possibility, that all primitive datatypes and arrays of them can be written to the fitsoutput. So if someone wants to add a new Array to the fits output, it is not necessary to change MWriteFitsFile.
This ticket occurs while working on ticket #1"	ftemme
Milestone 	13	Discontinue MAGIC support in FACT/Mars	component1		enhancement	somebody	new	2014-11-12T11:33:54Z	2014-11-16T20:48:17Z	"In a private discussion with Thomas Bretz he mentioned, that it might be a good idea to stop supporting MAGIC in our version of Mars. I welcome this decision very much, however I this needs of course to be agreed on by the majority of users/developers of Mars in FACT.

So, I put up this ticket mainly to have a place to discuss this (if a discussion is needed at all). As soon as the majority agrees, we will officially drop MAGIC support. That's it for the moment. No code will be deleted or so.

We just create a snapshot of the trunk, that is known to be the last version of FACT/Mars, where MAGIC support has not been officially dropped. (Of course we know, that it is not clear whether MAGIC data analysis was fully supported before). After this point in time, developers are free to throw away code, that is not needed by FACT anymore.

An important question of course is, are there any MAGIC members in FACT, that do use the FACT/Mars to analyze some MAGIC data? If this is the case please inform us now.

At the same time I would like to drop support for ROOT versions smaller than 5.0. So if anybody thinks we should still support ROOT 3 or 4, please speak up.

I propose to leave the discussion open for a couple of weeks (say 2 weeks) and if nobody is against this, I will advance with this task."	dneise
Milestone 	20	ratescan: add possibility to change fCounterMax and fResolution during runtime	component1		enhancement	somebody	new	2014-11-17T18:13:43Z	2014-12-01T12:39:57Z	"I think it might be useful to be able to change the values of fResolution and fCounterMax also at runtime, so that long running rate scans can be executed, without the need to restart the program.

I think it is fine to let the user change these values in any state, even in ""InProgress"", similar to CHANGE_STEP_SIZE and the like.

fCounterMax is only used in HandleTriggerRates() and even if the user changes fCounterMax during a ratescan for every step in a crazy way, the results will never be wrong.

The same is true for fResolution. The results will never be wrong, just there will be nothing like a minimal resolution anymore. But since for each point in a ratescan, we do not only store the rate, but also the time, it took to take the point, we have the resolution available for every point. So there is no problem."	dneise
Milestone 	5	Simulation of time jitter	component1		task	somebody	new	2014-04-08T12:40:11+01:00	2014-04-08T12:40:11+01:00	"(This ticket is derived from a mail from Thomas Bretz) 

I am not sure whether the simulation of time jitter (equal distribution of the width of one sample) makes any sense. So it should be checked.
"	dneise
Milestone 	24	Questions concerning dim version in FACT++	component1		task	somebody	new	2015-01-08T16:17:27Z	2015-02-04T10:08:36Z	"I would like to understand, what were the reasons to decide for including the source code of the dim library (http://dim.web.cern.ch/dim/) into the FACT++ source tree. 

I guess one of the reasons was, to make the build process simpler. No need to first download and build DIM, and then download and build FACT++, while making sure the compiler really finds the header files of DIM. But I think there were more reasons, which I don't remember.

Recently the FACT++ dim version has been updated from version 20.07 to 20.11. I would like to know, why this update has been done.

Dim services and commands are further specified by a ""service description string"". According to the format of this string, I found in the DIM documentation:

    Service description string, the contents of the service can be
    described in the form ""T:N;T:N;T"" where T is the data type : 
    C(har), 
    I(nt), 
    L(ong), 
    S(hort), 
    D(ouble), 
    F(loat) or 
    X(tra long) 
    and N is the number of items of that type. A data type alone at the
    end of string means all following items are of type T. [...]

However some commands in FACT++ have a description string, which is ""O"" (captital letter ""oh""). While apparently the DIM library does not mind using self defined format characters in the description strings, I would like to know, why this bug was exploited. 

The commands, which have this capital letter ""O"" description string are:

    AGILENT_CONTROL_24V/RECONNECT --> description string "" O ""
    AGILENT_CONTROL_50V/RECONNECT --> description string "" O ""
    AGILENT_CONTROL_80V/RECONNECT --> description string "" O ""
    BIAS_CONTROL/RECONNECT --> description string "" O ""
    DRIVE_CONTROL/RECONNECT --> description string "" O ""
    FSC_CONTROL/RECONNECT --> description string "" O ""
    FTM_CONTROL/RECONNECT --> description string "" O ""
    GCN/RECONNECT --> description string "" O ""
    GPS_CONTROL/RECONNECT --> description string "" O ""    
    SQM_CONTROL/RECONNECT --> description string "" O ""
    
What does this description string stand for, anyway? In my opinion a great feature of using the DIM library is to be able to access DIM services also from other platforms, and from software written in other languages. Do we not throw away this awesome feature, like this? And if so, what do we gain in return?

"	dneise
Milestone 	19	ratescan shows number of triggers as floating points	component1		defect	somebody	new	2014-11-17T09:42:58Z	2014-11-17T09:43:17Z	"The number of triggers is sometimes shown formatted as floating point, this might look puzzling to some users.

{{{
 I> 09:36:35.527624 - Triggers so far: 51 (0.140028)
 I> 09:36:36.527549 - Triggers so far: 54 (0.136083)
 I> 09:36:37.527528 - Triggers so far: 54 (0.136083)
 I> 09:36:38.527553 - Triggers so far: 55.9999 (0.133631)
 I> 09:36:39.527553 - Triggers so far: 56.0001 (0.133631)
 I> 09:36:40.527447 - Triggers so far: 58 (0.131306)
 I> 09:36:41.527431 - Triggers so far: 58.9999 (0.130189)
 I> 09:36:42.527439 - Triggers so far: 61.0001 (0.128037)
 I> 09:36:43.527525 - Triggers so far: 66 (0.123091)
 I> 09:36:44.527546 - Triggers so far: 68 (0.121268)
}}}

Nothing important really, just wanted to note it, so we don't forget to fix it at some point."	dneise
Milestone 	17	Why are build artifacts not ignored by svn	component1		enhancement	somebody	new	2014-11-14T13:26:10Z	2014-11-15T08:23:47Z	"I remember, that I once tried to add the build artifacts (*Cint.cc, *Cint.hm *Dep.d) created by the Mars build system to the svn:ignore property, but it was not regarded reasonable that time. 

I wanted to inform you, that there is a trivial way to ignore these artifacts without actually touching our svn repository, and thereby not affecting others.

In Ubuntu you should find a file called ~/.subversion/config in your home.
In order to ignore those files scroll down to the [miscellany] section and 
uncomment the 'global-ignores' line and simply append this to that line:
{{{
*Cint.cc *Cint.h *Dep.d
}}}

so in my case it looks like this
{{{
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__
     *.rej *~ #*# .#* .*.swp .DS_Store
     *Cint.cc *Cint.h *Dep.d
}}}

I still get shown all the binaries like (star, merpp, callisto, ...) that are build and wonder weather I should include them also into my global-ignores... not sure yet ... 

I still would rather like to include this into the svn:ignore property so not everybody has to edit his .subversion/config, but I guess it is still considered a no go, right?"	dneise
Milestone 	18	Why are there often internal and external include guards?	component1		enhancement	somebody	new	2014-11-15T06:32:07Z	2014-11-15T06:32:07Z	"Often one finds external include guards like:
{{{
#ifndef MARS_MInputStreamID
#include ""MInputStreamID.h""
#endif
}}}

While the file being included already has an internal guard

{{{
------ contents of MInputStreamID.h -------
#ifndef MARS_MInputStreamID
#define MARS_MInputStreamID

/* Definition of class MInputStreamID */

#endif
}}}

Is this needed by the ROOT CInt, or is it just a historical left over?"	dneise
Milestone milestone1	27	Wrong Free Disk Space on DAQ, displayed in SmartFACT	component1		defect	somebody	new	2016-09-16T14:25:30+01:00	2016-09-16T14:32:27+01:00	The free disk space of DAQ and displayed in SmartFACT is rapidly changing from 0 Byte, to 7007 Peta Byte, and to 12404 Peta Byte. This will effect observations when e.g. the QLA stopps because of missing free disk space.	smueller
Milestone milestone1	29	First Image of IR Cam is completely gray	component1		defect	somebody	new	2016-09-25T19:52:54+01:00	2016-09-26T11:34:15+01:00	After the recent upgrade, the first image of the IR cam only shows a gray frame. This also affects the shutdown checklist.	mnoethe
Milestone milestone1	30	Trouble creating logbooks entries	component1		defect	somebody	new	2016-09-28T10:08:09+01:00	2016-09-28T10:08:09+01:00	"Hello,

when creating logbook entries I get an error message. See the attached image.
When I enter 09:23  into the time field it works.  I have tried a few other time stamps. They don't work.

 [[Image()]]"	kbruegge
Milestone milestone1	31	cannot create logbook entries	component1		defect	somebody	new	2016-10-01T20:16:20+01:00	2016-10-02T11:16:41+01:00	"I think some20:00book thing similar has been reported already.
Yesterday I was still able to crate a logbook entry by playing with the time .. but today I have no chance.

"	dneise
Milestone milestone1	32	Broken Fits files in ceres output	component1		defect	somebody	new	2016-10-27T07:44:07+01:00	2016-11-10T14:56:45Z	When Ceres triggers no events. The fits file output contains nothing but some lines from the fits header. However the END keyword is missing from the header. As such they are not valid fits files and eventually produce exceptions in the programs trying to read the fits files. 	kbruegge
Milestone milestone1	36	svn does not (for me) on daq, data, gui and aux	component1		defect	somebody	new	2017-01-10T08:57:15Z	2017-01-10T08:57:15Z	"I am currently developing a new lidctrl. For this I am constantly building it and try it out. However since building the binary needs access to the svn, I cannot build on the machine I am executing the program.

This lidctrl needs to be executed on gui, since the lid-arduino is plugged in there. For some time I built it on newdaq, since svn works there for me, but I saw strange behaviour and wasn't sure the binary built on newdaq can safely be executed on gui.

Then I gave up and edited the makefile so it does not try to execute:

svnversion .n .

anymore.

This makes developing really painful for me, and I was curious if anybody else has the same problem."	dneise
Milestone milestone1	37	DimDescribedService ctor should check format string as datalogger does	component1		defect	somebody	new	2017-01-10T13:25:52Z	2017-01-10T13:25:52Z	"DimDescribedService should check the validity of the format string and refuse to start if the format string is invalid.

Otherwise it can happen that a non-godlike developer makes a typo in the format string. The dim-service still builds and starts nicely, but the datalogger, which is checking the validity of the format string, stops with an exception. 

Due to the automatic restart of each of our FACT++ programs the reason for the continuous restarting of the datalogger is very hard to see in the screen. But this is just a side note.

"	dneise
Milestone milestone1	40	Ceres is not able to read non compact Eventio	component1		defect	somebody	new	2017-06-11T17:30:30+01:00	2017-06-11T17:30:30+01:00	"When ceres is executet on non compact EventIO data non event is processed through ceres. I tested it by using the same simulation with compact and non comapct data. In case of compact multiple events get processed through the simulation chain.

I think the most possible reason for this error is the return value of

Int_t MPhotonData::FillEventIO(Float_t f[8]){
...
return n-1;
}

in

https://trac.fact-project.org/browser/trunk/Mars/msim/MPhotonData.cc

The function used for the compact format uses a ""return 1;""
"	dbaack
Milestone milestone1	41	copy+paste error in drivectrl.cc ?	component1		defect	somebody	new	2017-07-01T05:06:53+01:00	2017-07-01T05:06:53+01:00	"While reading drivectrl.cc I stumbled over this

https://trac.fact-project.org/browser/trunk/FACT%2B%2B/src/drivectrl.cc#L71

It's a typo right?"	dneise
Milestone milestone1	39	cannot reproduce run time optimization?	component1		enhancement	somebody	new	2017-03-12T14:51:46Z	2017-03-12T14:51:46Z	"While reviewing the drs calibration in Mars, I found some for loops which were optimized for runtime, to gain a factor of 250% in runtime. That's impressive. 

An example can be seen here:
https://trac.fact-project.org/browser/trunk/Mars/mcore/DrsCalib.h#L52

One can find the original code in a multiline comment above the optimized version. 

I originally wanted to verify that the optimized version really does the same as the un-optimized version, as I was to stupid to understand it, I simply let both versions do the same and compared the outcome.

It really did the same ... that's good. However I noticed no performance gain.
The compiler optimized both versions to run in roughly the same time. When switching compiler optimization off, I saw quite some gain in runtime, but we are not running our FACT++ code without compiler optimization, do we?

{{{
~/fact/Mars/mcore:$ make
g++ forloop_optim.cpp -o forloop_optim && ./forloop_optim
AddRel_simple took 11.969504 s.
AddRel_complex took 5.202990 s.
g++ -O2 forloop_optim.cpp -o forloop_optim && ./forloop_optim
AddRel_simple took 4.952487 s.
AddRel_complex took 4.896322 s.
}}}

I will try to attach the code and the makefile I used to test this.


Can you tell me, why I am not seeing the performance boost mentioned in the comment?"	dneise
Milestone milestone1	34	What is StateMachineRateControl.fBock supposed to be?	component1		task	somebody	new	2016-11-10T08:58:34Z	2016-11-29T11:15:03Z	"As discussed in yesterdays telcon, I should get the ratecontrol ready for testing the orbit mode. At the moment I try to fully understand the existing ratecontrol before making modifications.

I cannot understand the purpose of the variable named fBlock (vector<bool>).

It is initialized to be 40 elements long (which would imply it has something to do with the number of boards) and later it is resized

    fBlock.assign(160, false);

(which would imply it has something to do with the number of patches) 

however when it finally is used, only the first 40 of its 160 elements are looked at. 

    for (int i=0; i<40; i++)
    {
        if (fBlock[i])
        {
            fBlock[i] = false;
            continue;
        }
        // ...
    }
    
So now I'm puzzled what it is used for and the actual purpose is not clear to me.

"	dneise
Milestone milestone1	35	What are dp and db supposed to be?	component1		task	somebody	new	2016-11-12T15:24:13Z	2016-11-29T16:16:35Z	"In line 188 and 189 of ratecontrol.cc
two values called dp and db are caluclated. 
What are they supposed to mean? 

"	dneise
Milestone milestone1	38	errors should never pass silently?	component1		task	somebody	new	2017-03-07T16:44:24Z	2017-03-12T16:53:20Z	"I think here lurks a problem:

https://trac.fact-project.org/browser/trunk/Mars/mcore/DrsCalib.h#L58

""spos"" is the so called ""stop cell"" or ""start cell"" of a drs4 channel, so the allowed range is [0..1023]. In case this number is out of range the entire following calculation fails.

I am not saying this is a bug or so, I just say, when this number happens to be out of range ""continue"" is maybe not the correct reaction. 

What is the right reaction I cannot say. I don't understand the Mars and FACT++ framework well enough. I would throw an exception, since this is a fatal error."	dneise
