| Invalid Events in Prespec Code [message #19452] | 
			Fri, 19 August 2016 11:37   | 
		 
		
			
				
				
				
					
						  
						a_boso
						 Messages: 16 Registered: July 2014 
						
					 | 
					occasional visitor  | 
					From: 82.152.43*
  | 
		 
		 
	 | 
 
	
		Hi everybody! 
 
We noticed that in the 46Cr Coulex part of our analysis (which is the more exotic of the experiment) we have almost 90% of invalid events (events in which the "valid flag" is 0 in all the variables, especially in S4 scintillator). This is not the case in the 46Ti Coulex part where the invalid events where only ~30%. 
 
This is somehow surprising since the beam rates in S4 were: 
 
46Cr 
~800 counts per spill (1.2 s) 
 
46Ti 
1e5 counts per spill (10s) 
 
 
If we could recover a situation similar to that of 46Ti it would make a huge difference for the outcome of the analysis. 
 
So I was wondering.. what does "invalid event" mean? How it is decided in the code if an event is valid or not? Is there a way to "relax" this condition and somehow recover some events? 
 
 
Do you have any idea why we have such a great amount of invalid events? 
 
Thanks!! 
Alberto
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	
		
		
			| Re: Invalid Events in Prespec Code [message #19455 is a reply to message #19452] | 
			Fri, 19 August 2016 15:03    | 
		 
		
			
				
				
				
					
						  
						Michael Reese
						 Messages: 9 Registered: August 2016 
						
					 | 
					occasional visitor  | 
					From: *gsi.de
  | 
		 
		 
	 | 
 
	
		Hi, 
 
The valid flag of any value is set if the value was successfully computed. That happens when the  
set_output(NAME_OF_VALUE, 42)
  
inside any processor is called. That means, if the value has no valid flag set, it was not successfully computed.  
Usually, processors are written in a way that they check for the requirements of a computation 
if (input_valid(NAME_OF_NECESSARY_INPUT_1) && input_valid(NAME_OF_NECESSARY_INPUT_2))
{
  double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
  double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
  double result = f(input1,input2);
  set_output(NAME_OF_RESULT, result);
}
 
This guarantees to have only meaningful information propagating along the graph. You can try to track down in which processor the information is missing. With that information I could give a more detailed answer.  
 
In general you can try if it is possible to write a more sophisticated algorithm, such as this: 
if (input_valid(NAME_OF_NECESSARY_INPUT_1) && input_valid(NAME_OF_NECESSARY_INPUT_2))
{
  double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
  double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
  double result = f(input1,input2); // f is an algorithm that calculates the result from the two given numbers
  set_output(NAME_OF_RESULT, result);
}
else if (input_valid(NAME_OF_NECESSARY_INPUT_1))
{
  double input1 = input_value(NAME_OF_NECESSARY_INPUT_1);
  // make a clever computation that needs only one of the values
  double result = f2(input1); // f2 is a sophisticated algorithm that calculates the result only with one number
  set_output(NAME_OF_RESULT, result);
}
else if (input_valid(NAME_OF_NECESSARY_INPUT_2))
{
  double input2 = input_value(NAME_OF_NECESSARY_INPUT_2);
  // make a clever computation that needs only the other value
  double result = f3(input2); // f3 is a sophisticated algorithm that calculates the result only with one number
  set_output(NAME_OF_RESULT, result);
}
 
 
Best regards, 
Michael  
		
		
		[Updated on: Fri, 19 August 2016 15:04] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 |